|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sdnplatform.sync.internal.rpc.TProtocolUtil
public class TProtocolUtil
Some utility methods for constructing Thrift messages
Field Summary | |
---|---|
protected static org.slf4j.Logger |
logger
|
Constructor Summary | |
---|---|
TProtocolUtil()
|
Method Summary | |
---|---|
static ISyncService.Scope |
getScope(org.sdnplatform.sync.thrift.Scope tScope)
Convert a org.sdnplatform.sync.thrift.Scope into a
ISyncService.Scope |
static KeyedValues |
getTKeyedValues(ByteArray key,
java.lang.Iterable<Versioned<byte[]>> values)
Construct a thrift org.sdnplatform.sync.thrift.KeyedValues |
static KeyedValues |
getTKeyedValues(ByteArray key,
Versioned<byte[]>... value)
Construct a thrift org.sdnplatform.sync.thrift.KeyedValues |
static KeyedVersions |
getTKeyedVersions(ByteArray key,
java.util.List<Versioned<byte[]>> values)
Construct a thrift org.sdnplatform.sync.thrift.KeyedValues |
static org.sdnplatform.sync.thrift.Scope |
getTScope(ISyncService.Scope Scope)
Convert a ISyncService.Scope into a
org.sdnplatform.sync.thrift.Scope |
static org.sdnplatform.sync.thrift.Store |
getTStore(java.lang.String storeName,
ISyncService.Scope scope,
boolean persist)
Allocate a thrift org.sdnplatform.sync.thrift.Store object
for the current store |
static org.sdnplatform.sync.thrift.Store |
getTStore(java.lang.String storeName,
org.sdnplatform.sync.thrift.Scope scope,
boolean persist)
Allocate a thrift org.sdnplatform.sync.thrift.Store object
for the current store |
static SyncMessage |
getTSyncOfferMessage(java.lang.String storeName,
ISyncService.Scope scope,
boolean persist)
Get a partially-initialized SyncOfferMessage wrapped with a
SyncMessage . |
static SyncMessage |
getTSyncValueMessage(Store store)
Get a partially-initialized SyncValueMessage wrapped with a
SyncMessage . |
static SyncMessage |
getTSyncValueMessage(java.lang.String storeName,
ISyncService.Scope scope,
boolean persist)
Get a partially-initialized SyncValueMessage wrapped with a
SyncMessage . |
static org.sdnplatform.sync.thrift.VectorClock |
getTVectorClock(VectorClock vc)
Convert a VectorClock into a
org.sdnplatform.sync.thrift.VectorClock |
static org.sdnplatform.sync.thrift.VersionedValue |
getTVersionedValue(Versioned<byte[]> value)
Allocate a thrift org.sdnplatform.sync.thrift.VersionedValue
object wrapping a Versioned object |
static VectorClock |
getVersion(org.sdnplatform.sync.thrift.VectorClock tvc)
Convert a thrift org.sdnplatform.sync.thrift.VectorClock into
a VectorClock . |
static java.util.List<Versioned<byte[]>> |
getVersionedList(java.util.List<VersionedValue> tvv)
Convert from a list of VersionedValue to a list
of Versioned |
static Versioned<byte[]> |
getVersionedValued(VersionedValue tvv)
Convert a thrift VersionedValue into a Versioned . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger logger
Constructor Detail |
---|
public TProtocolUtil()
Method Detail |
---|
public static org.sdnplatform.sync.thrift.VectorClock getTVectorClock(VectorClock vc)
VectorClock
into a
org.sdnplatform.sync.thrift.VectorClock
vc
- the input clock
public static org.sdnplatform.sync.thrift.VersionedValue getTVersionedValue(Versioned<byte[]> value)
org.sdnplatform.sync.thrift.VersionedValue
object wrapping a Versioned
object
value
- the value to wrap
public static KeyedValues getTKeyedValues(ByteArray key, Versioned<byte[]>... value)
org.sdnplatform.sync.thrift.KeyedValues
key
- the keyvalue
- the versioned values
public static KeyedValues getTKeyedValues(ByteArray key, java.lang.Iterable<Versioned<byte[]>> values)
org.sdnplatform.sync.thrift.KeyedValues
key
- the keyvalues
- the versioned values
public static KeyedVersions getTKeyedVersions(ByteArray key, java.util.List<Versioned<byte[]>> values)
org.sdnplatform.sync.thrift.KeyedValues
key
- the keyvalue
- the versioned values
public static org.sdnplatform.sync.thrift.Store getTStore(java.lang.String storeName, ISyncService.Scope scope, boolean persist)
org.sdnplatform.sync.thrift.Store
object
for the current store
storeName
- the name of the storescope
- the scope of the storepersist
- whether the store is persistent
public static org.sdnplatform.sync.thrift.Store getTStore(java.lang.String storeName, org.sdnplatform.sync.thrift.Scope scope, boolean persist)
org.sdnplatform.sync.thrift.Store
object
for the current store
storeName
- the name of the storescope
- the scope of the storepersist
- whether the store is persistent
public static ISyncService.Scope getScope(org.sdnplatform.sync.thrift.Scope tScope)
org.sdnplatform.sync.thrift.Scope
into a
ISyncService.Scope
tScope
- the org.sdnplatform.sync.thrift.Scope
to convert
ISyncService.Scope
public static org.sdnplatform.sync.thrift.Scope getTScope(ISyncService.Scope Scope)
ISyncService.Scope
into a
org.sdnplatform.sync.thrift.Scope
tScope
- the ISyncService.Scope
to convert
org.sdnplatform.sync.thrift.Scope
public static SyncMessage getTSyncValueMessage(java.lang.String storeName, ISyncService.Scope scope, boolean persist)
SyncValueMessage
wrapped with a
SyncMessage
. The values will not be set in the
SyncValueMessage
, and the transaction ID will not be set in
the AsyncMessageHeader
.
storeName
- the store namescope
- the scopepersist
- whether the store is persistent
SyncMessage
public static SyncMessage getTSyncValueMessage(Store store)
SyncValueMessage
wrapped with a
SyncMessage
. The values will not be set in the
SyncValueMessage
, and the transaction ID will not be set in
the AsyncMessageHeader
.
store
- the Store
associated with the message
SyncMessage
public static SyncMessage getTSyncOfferMessage(java.lang.String storeName, ISyncService.Scope scope, boolean persist)
SyncOfferMessage
wrapped with a
SyncMessage
.
storeName
- the name of the store associated with the messagescope
- the ISyncService.Scope
for the storepersist
- the scope for the store
SyncMessage
public static VectorClock getVersion(org.sdnplatform.sync.thrift.VectorClock tvc)
org.sdnplatform.sync.thrift.VectorClock
into
a VectorClock
.
tvc
- the org.sdnplatform.sync.thrift.VectorClock
the
- VectorClock
public static Versioned<byte[]> getVersionedValued(VersionedValue tvv)
VersionedValue
into a Versioned
.
tvv
- the VersionedValue
Versioned
public static java.util.List<Versioned<byte[]>> getVersionedList(java.util.List<VersionedValue> tvv)
VersionedValue
to a list
of Versioned
tvv
- the list of versioned values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |