本文整理汇总了Java中edu.uw.zookeeper.protocol.Operation.ProtocolResponse方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.ProtocolResponse方法的具体用法?Java Operation.ProtocolResponse怎么用?Java Operation.ProtocolResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.uw.zookeeper.protocol.Operation
的用法示例。
在下文中一共展示了Operation.ProtocolResponse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromSchema
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static <E extends Materializer.MaterializedNode<E,?>, O extends Operation.ProtocolResponse<?>> Materializer<E,O> fromSchema(
SchemaElementLookup schema,
Class<? extends E> rootType,
Serializers.ByteCodec<Object> codec,
ClientExecutor<? super Records.Request, O, SessionListener> client) {
E root = null;
for (Constructor<?> ctor: rootType.getConstructors()) {
if (ctor.getParameterTypes().length == 2) {
try {
root = (E) ctor.newInstance(schema.get().root(), codec);
} catch (Exception e) {
throw new IllegalArgumentException(String.format("Error calling constructor %s", ctor), e);
}
break;
}
}
if (root == null) {
throw new IllegalArgumentException(String.format("Can't find constructor in %s", rootType));
}
return newInstance(schema, codec, client, root);
}
示例2: randomCache
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <O extends Operation.ProtocolResponse<?>> LockableZNodeCache<ZNodeCache.SimpleCacheNode, Operation.Request, O> randomCache(
int iterations,
TimeValue timeOut,
ClientExecutor<Operation.Request,O,SessionListener> client,
Logger logger) throws KeeperException, InterruptedException, ExecutionException, TimeoutException {
LockableZNodeCache<ZNodeCache.SimpleCacheNode, Operation.Request, O> cache =
LockableZNodeCache.newInstance(
client);
Generator<Records.Request> requests = RandomRequestGenerator.fromCache(cache);
CountingGenerator<Pair<Records.Request, ListenableFuture<O>>> operations =
CountingGenerator.create(iterations, iterations,
SubmitGenerator.create(requests, cache), logger);
while (operations.hasNext()) {
Pair<Records.Request, ListenableFuture<O>> operation = operations.next();
Operations.unlessError(operation.second().get(timeOut.value(), timeOut.unit()).record());
}
return cache;
}
示例3: newInstance
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <E extends Materializer.MaterializedNode<E,?>, O extends Operation.ProtocolResponse<?>> Materializer<E,O> newInstance(
SchemaElementLookup schema,
Serializers.ByteCodec<Object> codec,
ClientExecutor<? super Records.Request,O,SessionListener> client,
E root) {
return new Materializer<E,O>(schema, codec, LockableZNodeCache.<E,Records.Request,O>newInstance(client, root));
}
示例4: newInstance
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
protected abstract C newInstance(
ZxidGenerator zxids,
NameTrie<ZNodeNode> data,
SessionManager sessions,
ReentrantReadWriteLock lock,
Watches dataWatches,
Watches childWatches,
Function<Long, ? extends NotificationListener<Operation.ProtocolResponse<IWatcherEvent>>> listeners,
RuntimeModule runtime);
示例5: fromHierarchy
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <E extends Materializer.MaterializedNode<E,?>, O extends Operation.ProtocolResponse<?>> Materializer<E,O> fromHierarchy(
Class<? extends E> rootType,
Serializers.ByteCodec<Object> codec,
ClientExecutor<? super Records.Request, O, SessionListener> client) {
SchemaElementLookup schema = SchemaElementLookup.fromHierarchy(rootType);
return fromSchema(schema, rootType, codec, client);
}
示例6: onSuccess
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
@Override
public void onSuccess(Operation.ProtocolResponse<?> result) {
if (result.record().opcode() == OpCode.CLOSE_SESSION) {
set(Boolean.TRUE);
}
}
示例7: create
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <V extends Operation.ProtocolResponse<?>, T extends SessionListener> SessionClientExecutor<V,T> create(
long sessionId,
ClientExecutor<SessionOperation.Request<?>, V, T> delegate) {
return new SessionClientExecutor<V,T>(sessionId, delegate);
}
示例8: create
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <I extends Operation.Request, O extends Operation.ProtocolResponse<?>, T extends SessionListener> ClientExecutor<? super I, O, T> create(
Configuration configuration,
ClientExecutor<? super I, O, T> client) {
return create(ConfigurableLimit.get(configuration), client);
}
示例9: newInstance
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <E extends AbstractNameTrie.SimpleNode<E> & ZNodeCache.CacheNode<E,?>,I extends Operation.Request, O extends Operation.ProtocolResponse<?>> ZNodeCache<E,I,O> newInstance(
ClientExecutor<? super I,O,SessionListener> client, E root) {
return new ZNodeCache<E,I,O>(client, new CacheEvents(new StrongConcurrentSet<CacheListener>()), SimpleLabelTrie.forRoot(root));
}
示例10: forFunction
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <I extends Function<ZNodePath, ? extends List<? extends Records.Request>>, O extends Operation.ProtocolResponse<?>> PathToQuery<I, O> forFunction(ClientExecutor<? super Records.Request,O,?> client, I requests) {
return new PathToQuery<I, O>(requests, client);
}
示例11: submitRequests
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <I extends Operation.Request, O extends Operation.ProtocolResponse<?>> SubmittedRequests<I,O> submitRequests(TaskExecutor<? super I,? extends O> client, I... requests) {
return submit(client, ImmutableList.copyOf(requests));
}
示例12: setClient
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public Builder<V> setClient(ClientExecutor<? super Records.Request, ? extends Operation.ProtocolResponse<?>, ?> client) {
return newInstance(root, requests, iterator, result, client, executor);
}
示例13: handleResult
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
protected void handleResult(Records.Request request, Operation.ProtocolResponse<?> result) {
ImmutableSet.Builder<NodeWatchEvent> events = ImmutableSet.builder();
handleResult(request, result, events);
events().handleCacheEvent(events.build());
}
示例14: newInstance
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <I extends Operation.Request,O extends Operation.ProtocolResponse<?>> LockableZNodeCache<SimpleCacheNode,I,O> newInstance(
ClientExecutor<? super I,O,SessionListener> client) {
return newInstance(client, SimpleCacheNode.root());
}
示例15: unlessProtocolError
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static <T extends Operation.ProtocolResponse<?>> T unlessProtocolError(Records.PathGetter request, T response) throws KeeperException {
return unlessProtocolError(response, request.getPath());
}