本文整理汇总了Java中org.sdnplatform.sync.thrift.KeyedValues类的典型用法代码示例。如果您正苦于以下问题:Java KeyedValues类的具体用法?Java KeyedValues怎么用?Java KeyedValues使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KeyedValues类属于org.sdnplatform.sync.thrift包,在下文中一共展示了KeyedValues类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChunk
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
private Iterator<KeyedValues> getChunk() {
CursorRequestMessage crm = getCRM();
crm.setCursorId(cursorId);
SyncMessage bsm = new SyncMessage(MessageType.CURSOR_REQUEST);
bsm.setCursorRequest(crm);
SyncReply reply;
try {
reply = getReply(crm.getHeader().getTransactionId(),
bsm);
} catch (SyncException e) {
throw new SyncRuntimeException(e);
}
if (reply.getKeyedValues() == null ||
reply.getKeyedValues().size() == 0) return null;
return reply.getKeyedValues().iterator();
}
示例2: getChunk
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
private Iterator<KeyedValues> getChunk() {
CursorRequestMessage crm = getCRM();
crm.setCursorId(cursorId);
SyncMessage bsm = new SyncMessage(MessageType.CURSOR_REQUEST);
bsm.setCursorRequest(crm);
SyncReply reply;
try {
reply = getReply(crm.getHeader().getTransactionId(),
bsm);
} catch (SyncException e) {
throw new SyncRuntimeException(e);
}
if (reply.getKeyedValues() == null ||
reply.getKeyedValues().size() == 0) return null;
return reply.getKeyedValues().iterator();
}
示例3: getTKeyedValues
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
/**
* Construct a thrift {@link org.sdnplatform.sync.thrift.KeyedValues}
* @param key the key
* @param value the versioned values
* @return the thrift object
*/
@SafeVarargs
public static KeyedValues getTKeyedValues(ByteArray key,
Versioned<byte[]>... value) {
KeyedValues kv = new KeyedValues();
kv.setKey(key.get());
for (Versioned<byte[]> v : value) {
kv.addToValues(getTVersionedValue(v));
}
return kv;
}
示例4: hasNext
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
@Override
public boolean hasNext() {
if (currentChunk != null) {
if (currentChunk.hasNext())
return true;
}
Iterator<KeyedValues> nextChunk = getChunk();
if (nextChunk != null) {
currentChunk = nextChunk;
return nextChunk.hasNext();
}
return false;
}
示例5: next
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
@Override
public Entry<ByteArray, List<Versioned<byte[]>>> next() {
if (!hasNext()) throw new NoSuchElementException();
KeyedValues kv = currentChunk.next();
ByteArray k = new ByteArray(kv.getKey());
List<Versioned<byte[]>> v =
TProtocolUtil.getVersionedList(kv.getValues());
return new Pair<ByteArray, List<Versioned<byte[]>>>(k, v);
}
示例6: SyncReply
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
public SyncReply(List<Versioned<byte[]>> values,
List<KeyedValues> keyedValues,
boolean success, SyncException error, int intValue) {
super();
this.values = values;
this.keyedValues = keyedValues;
this.success = success;
this.error = error;
this.intValue = intValue;
}
示例7: getTKeyedValues
import org.sdnplatform.sync.thrift.KeyedValues; //导入依赖的package包/类
/**
* Construct a thrift {@link org.sdnplatform.sync.thrift.KeyedValues}
* @param key the key
* @param value the versioned values
* @return the thrift object
*/
public static KeyedValues getTKeyedValues(ByteArray key,
Versioned<byte[]>... value) {
KeyedValues kv = new KeyedValues();
kv.setKey(key.get());
for (Versioned<byte[]> v : value) {
kv.addToValues(getTVersionedValue(v));
}
return kv;
}