本文整理汇总了Java中org.sdnplatform.sync.internal.rpc.TProtocolUtil类的典型用法代码示例。如果您正苦于以下问题:Java TProtocolUtil类的具体用法?Java TProtocolUtil怎么用?Java TProtocolUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TProtocolUtil类属于org.sdnplatform.sync.internal.rpc包,在下文中一共展示了TProtocolUtil类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: put
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的package包/类
@Override
public void put(ByteArray key, Versioned<byte[]> value)
throws SyncException {
StoreUtils.assertValidKey(key);
PutRequestMessage prm = new PutRequestMessage();
AsyncMessageHeader header = new AsyncMessageHeader();
header.setTransactionId(syncManager.getTransactionId());
prm.setHeader(header);
prm.setVersionedValue(TProtocolUtil.getTVersionedValue(value));
prm.setKey(key.get());
prm.setStoreName(storeName);
SyncMessage bsm = new SyncMessage(MessageType.PUT_REQUEST);
bsm.setPutRequest(prm);
getReply(header.getTransactionId(), bsm);
}
示例2: put
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的package包/类
@Override
public void put(ByteArray key, Versioned<byte[]> value)
throws SyncException {
StoreUtils.assertValidKey(key);
PutRequestMessage prm = new PutRequestMessage();
AsyncMessageHeader header = new AsyncMessageHeader();
header.setTransactionId(syncManager.getTransactionId());
prm.setHeader(header);
prm.setVersionedValue(TProtocolUtil.getTVersionedValue(value));
prm.setKey(key.get());
prm.setStoreName(storeName);
SyncMessage bsm = new SyncMessage(MessageType.PUT_REQUEST);
bsm.setPutRequest(prm);
getReply(header.getTransactionId(), bsm);
}
示例3: getMessage
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的package包/类
/**
* Allocate a partially-initialized {@link SyncMessage} object for
* the given store
* @param store the store
* @return the {@link SyncMessage} object
*/
private SyncMessage getMessage(SynchronizingStorageEngine store) {
String storeName = store.getName();
SyncMessage bsm = messages.get(storeName);
if (bsm == null) {
bsm = TProtocolUtil.getTSyncValueMessage(storeName,
store.getScope(),
store.isPersistent());
messages.put(storeName, bsm);
}
return bsm;
}
示例4: handleGetResponse
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的package包/类
@Override
protected void handleGetResponse(GetResponseMessage response,
Channel channel) {
List<Versioned<byte[]>> values =
TProtocolUtil.getVersionedList(response.getValues());
SyncReply reply = new SyncReply(values, null, true, null, 0);
syncManager.dispatchReply(response.getHeader().getTransactionId(),
reply);
}
示例5: next
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的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: getMessage
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的package包/类
/**
* Allocate a partially-initialized {@link SyncMessage} object for
* the given store
* @param store the store
* @return the {@link SyncMessage} object
*/
private SyncMessage getMessage(SynchronizingStorageEngine store) {
String storeName = store.getName();
SyncMessage bsm = messages.get(storeName);
if (bsm == null) {
bsm = TProtocolUtil.getTSyncValueMessage(storeName,
store.getScope(),
store.isPersistent());
messages.put(storeName, bsm);
}
return bsm;
}
示例7: handleGetResponse
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的package包/类
@Override
protected void handleGetResponse(GetResponseMessage response,
Channel channel) {
List<Versioned<byte[]>> values =
TProtocolUtil.getVersionedList(response.getValues());
SyncReply reply = new SyncReply(values, null, true, null, 0);
syncManager.dispatchReply(response.getHeader().getTransactionId(),
reply);
}
示例8: next
import org.sdnplatform.sync.internal.rpc.TProtocolUtil; //导入依赖的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);
}