当前位置: 首页>>代码示例>>Java>>正文


Java TProtocolUtil类代码示例

本文整理汇总了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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:RemoteStore.java

示例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);
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:19,代码来源:RemoteStore.java

示例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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:18,代码来源:SyncManager.java

示例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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:10,代码来源:RemoteSyncChannelHandler.java

示例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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:11,代码来源:RemoteStore.java

示例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;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:18,代码来源:SyncManager.java

示例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);
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:10,代码来源:RemoteSyncChannelHandler.java

示例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);
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:11,代码来源:RemoteStore.java


注:本文中的org.sdnplatform.sync.internal.rpc.TProtocolUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。