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


Java Operation.ProtocolResponse方法代码示例

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

示例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;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:19,代码来源:RandomSingleClientTest.java

示例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));
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:8,代码来源:Materializer.java

示例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);
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:10,代码来源:SimpleServer.java

示例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);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:8,代码来源:Materializer.java

示例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);
    }
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:7,代码来源:AbstractConnectionClientExecutor.java

示例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);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:6,代码来源:SessionClientExecutor.java

示例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);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:6,代码来源:LimitOutstandingClient.java

示例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));
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:5,代码来源:ZNodeCache.java

示例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);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:4,代码来源:PathToQuery.java

示例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));
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:4,代码来源:SubmittedRequests.java

示例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);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:4,代码来源:TreeWalker.java

示例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());
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:6,代码来源:ZNodeCache.java

示例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());
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:5,代码来源:LockableZNodeCache.java

示例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());
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:4,代码来源:Operations.java


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