本文整理了Java中com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeySliceQuery.getLimit()
本文整理了Java中com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeySliceQuery.getLimit()
方法的一些代码示例,展示了KeySliceQuery.getLimit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeySliceQuery.getLimit()
方法的具体详情如下:
包路径:com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeySliceQuery
类名称:KeySliceQuery
方法名:getLimit
KeySliceQuery.getLimit介绍
暂无
代码示例
代码示例来源:origin: thinkaurelius/titan
@Override
public String toString() {
return String.format("KeySliceQuery(key: %s, start: %s, end: %s, limit:%d)", key, getSliceStart(), getSliceEnd(), getLimit());
}
}
代码示例来源:origin: thinkaurelius/titan
final KVQuery convertQuery(final KeySliceQuery query) {
Predicate filter = Predicates.alwaysTrue();
if (!hasFixedKeyLength()) filter = new Predicate() {
@Override
public boolean apply(@Nullable StaticBuffer keyAndColumn) {
return equalKey(keyAndColumn, query.getKey());
}
};
return new KVQuery(
concatenatePrefix(query.getKey(), query.getSliceStart()),
concatenatePrefix(query.getKey(), query.getSliceEnd()),
filter,query.getLimit());
}
代码示例来源:origin: thinkaurelius/titan
EntryList getSlice(KeySliceQuery query, StoreTransaction txh) {
Lock lock = getLock(txh);
lock.lock();
try {
Data datacp = data;
int start = datacp.getIndex(query.getSliceStart());
if (start <0) start = (-start - 1);
int end = datacp.getIndex(query.getSliceEnd());
if (end <0) end = (-end - 1);
if (start MemoryEntryList result = new MemoryEntryList(end - start);
for (int i = start; i if (query.hasLimit() && result.size() >= query.getLimit()) break;
result.add(datacp.get(i));
}
return result;
} else {
return EntryList.EMPTY_LIST;
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: thinkaurelius/titan
Composite endComposite = CellNames.simpleDense(query.getSliceEnd().asByteBuffer());
SliceQueryFilter sqf = new SliceQueryFilter(startComposite, endComposite,
false, query.getLimit() + (query.hasLimit()?1:0));
ReadCommand sliceCmd = new SliceFromReadCommand(keyspace, query.getKey().asByteBuffer(), columnFamily, nowMillis, sqf);
entryGetter,
query.getSliceEnd(),
query.getLimit());
代码示例来源:origin: org.hawkular.titan/titan-core
@Override
public String toString() {
return String.format("KeySliceQuery(key: %s, start: %s, end: %s, limit:%d)", key, getSliceStart(), getSliceEnd(), getLimit());
}
}
代码示例来源:origin: com.thinkaurelius.titan/titan-core
@Override
public String toString() {
return String.format("KeySliceQuery(key: %s, start: %s, end: %s, limit:%d)", key, getSliceStart(), getSliceEnd(), getLimit());
}
}
代码示例来源:origin: com.thinkaurelius.titan/titan-hazelcast
if (query.hasLimit() && count >= query.getLimit())
break;
代码示例来源:origin: com.thinkaurelius.titan/titan-core
final KVQuery convertQuery(final KeySliceQuery query) {
Predicate filter = Predicates.alwaysTrue();
if (!hasFixedKeyLength()) filter = new Predicate() {
@Override
public boolean apply(@Nullable StaticBuffer keyAndColumn) {
return equalKey(keyAndColumn, query.getKey());
}
};
return new KVQuery(
concatenatePrefix(query.getKey(), query.getSliceStart()),
concatenatePrefix(query.getKey(), query.getSliceEnd()),
filter,query.getLimit());
}
代码示例来源:origin: org.hawkular.titan/titan-core
final KVQuery convertQuery(final KeySliceQuery query) {
Predicate filter = Predicates.alwaysTrue();
if (!hasFixedKeyLength()) filter = new Predicate() {
@Override
public boolean apply(@Nullable StaticBuffer keyAndColumn) {
return equalKey(keyAndColumn, query.getKey());
}
};
return new KVQuery(
concatenatePrefix(query.getKey(), query.getSliceStart()),
concatenatePrefix(query.getKey(), query.getSliceEnd()),
filter,query.getLimit());
}
代码示例来源:origin: org.hawkular.titan/titan-core
EntryList getSlice(KeySliceQuery query, StoreTransaction txh) {
Lock lock = getLock(txh);
lock.lock();
try {
Data datacp = data;
int start = datacp.getIndex(query.getSliceStart());
if (start <0) start = (-start - 1);
int end = datacp.getIndex(query.getSliceEnd());
if (end <0) end = (-end - 1);
if (start MemoryEntryList result = new MemoryEntryList(end - start);
for (int i = start; i if (query.hasLimit() && result.size() >= query.getLimit()) break;
result.add(datacp.get(i));
}
return result;
} else {
return EntryList.EMPTY_LIST;
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: com.thinkaurelius.titan/titan-core
EntryList getSlice(KeySliceQuery query, StoreTransaction txh) {
Lock lock = getLock(txh);
lock.lock();
try {
Data datacp = data;
int start = datacp.getIndex(query.getSliceStart());
if (start <0) start = (-start - 1);
int end = datacp.getIndex(query.getSliceEnd());
if (end <0) end = (-end - 1);
if (start MemoryEntryList result = new MemoryEntryList(end - start);
for (int i = start; i if (query.hasLimit() && result.size() >= query.getLimit()) break;
result.add(datacp.get(i));
}
return result;
} else {
return EntryList.EMPTY_LIST;
}
} finally {
lock.unlock();
}
}
代码示例来源:origin: org.hawkular.titan/titan-cassandra
SliceQueryFilter sqf = new SliceQueryFilter(query.getSliceStart().asByteBuffer(), query.getSliceEnd().asByteBuffer(), false, query.getLimit() + (query.hasLimit()?1:0));
ReadCommand sliceCmd = new SliceFromReadCommand(keyspace, query.getKey().asByteBuffer(), columnFamily, nowMillis, sqf);
entryGetter,
query.getSliceEnd(),
query.getLimit());
代码示例来源:origin: com.thinkaurelius.titan/titan-cassandra
Composite endComposite = CellNames.simpleDense(query.getSliceEnd().asByteBuffer());
SliceQueryFilter sqf = new SliceQueryFilter(startComposite, endComposite,
false, query.getLimit() + (query.hasLimit()?1:0));
ReadCommand sliceCmd = new SliceFromReadCommand(keyspace, query.getKey().asByteBuffer(), columnFamily, nowMillis, sqf);
entryGetter,
query.getSliceEnd(),
query.getLimit());