Examples of VersionedProtocol


Examples of org.apache.hadoop.ipc.VersionedProtocol

    return proxy;
  }

  @Override
  public VersionedProtocol getProxy(String nodeName, boolean establishIfNoExists) {
    VersionedProtocol versionedProtocol = _node2ProxyMap.get(nodeName);
    if (versionedProtocol == null && establishIfNoExists) {
      synchronized (nodeName.intern()) {
        if (!_node2ProxyMap.containsKey(nodeName)) {
          try {
            versionedProtocol = createNodeProxy(nodeName);
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

    synchronized (nodeName.intern()) {
      if (_node2ProxyMap.containsKey(nodeName)) {
        LOG.warn("removing proxy for node '" + nodeName + "' after " + failureCount + " proxy-invocation errors");
        _failedNodeInteractions.remove(nodeName, Integer.MAX_VALUE);
        _selectionPolicy.removeNode(nodeName);
        VersionedProtocol proxy = _node2ProxyMap.remove(nodeName);
        RPC.stopProxy(proxy);
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

                }

                @Override
                public void added(String nodeName) {
                  LOG.info("shard '" + shardName + "' added to node '" + nodeName + "'");
                  VersionedProtocol proxy = _proxyManager.getProxy(nodeName, true);
                  if (proxy != null) {
                    Collection<String> shardNodes = new ArrayList<String>(_selectionPolicy.getShardNodes(shardName));
                    shardNodes.add(nodeName);
                    _selectionPolicy.update(shardName, shardNodes);
                  }
                }
              });
      Collection<String> shardNodes = new ArrayList<String>(3);
      for (String node : nodes) {
        VersionedProtocol proxy = _proxyManager.getProxy(node, true);
        if (proxy != null) {
          shardNodes.add(node);
        }
      }
      _selectionPolicy.update(shardName, shardNodes);
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

    public VersionedProtocol getProxy(String node) {
      if (returnNullNodes.contains(node)) {
        return null;
      }
      VersionedProtocol vp = proxyCache.get(node);
      if (vp != null) {
        return vp;
      }
      TestServer ts = new TestServer(node);
      serverCache.put(node, ts);
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

  @SuppressWarnings("unchecked")
  public void run() {
    String methodDesc = null;
    try {
      VersionedProtocol proxy = _shardManager.getProxy(_node, false);
      if (proxy == null) {
        throw new KattaException("No proxy for node: " + _node);
      }
      if (_shardArrayIndex >= 0) {
        // We need to pass the list of shards to the server's method.
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

   */
  public static VersionedProtocol getProxy(Class<?> protocol,
      long clientVersion, InetSocketAddress addr, UserGroupInformation ticket,
      Configuration conf, SocketFactory factory)
  throws IOException {
    VersionedProtocol proxy =
        (VersionedProtocol) Proxy.newProxyInstance(
            protocol.getClassLoader(), new Class[] { protocol },
            new Invoker(addr, ticket, conf, factory));
    long serverVersion = proxy.getProtocolVersion(protocol.getName(),
                                                  clientVersion);
    if (serverVersion == clientVersion) {
      return proxy;
    }
    throw new VersionMismatch(protocol.getName(), clientVersion,
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

   * talking to a server at the named address. */
  public static VersionedProtocol getProxy(Class<?> protocol,
      long clientVersion, InetSocketAddress addr, UserGroupInformation ticket,
      Configuration conf, SocketFactory factory) throws IOException {   

    VersionedProtocol proxy =
        (VersionedProtocol) Proxy.newProxyInstance(
            protocol.getClassLoader(), new Class[] { protocol },
            new Invoker(addr, ticket, conf, factory));
    long serverVersion = proxy.getProtocolVersion(protocol.getName(),
                                                  clientVersion);
    if (serverVersion == clientVersion) {
      return proxy;
    } else {
      throw new VersionMismatch(protocol.getName(), clientVersion,
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

   */
  public static VersionedProtocol getProxy(Class<?> protocol,
      long clientVersion, InetSocketAddress addr, UserGroupInformation ticket,
      Configuration conf, SocketFactory factory) throws IOException {   

    VersionedProtocol proxy =
        (VersionedProtocol) Proxy.newProxyInstance(
            protocol.getClassLoader(), new Class[] { protocol },
            new Invoker(addr, ticket, conf, factory));
    long serverVersion = proxy.getProtocolVersion(protocol.getName(),
                                                  clientVersion);
    if (serverVersion == clientVersion) {
      return proxy;
    } else {
      throw new VersionMismatch(protocol.getName(), clientVersion,
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

   */
  public static VersionedProtocol getProxy(Class<?> protocol,
      long clientVersion, InetSocketAddress addr, UserGroupInformation ticket,
      Configuration conf, SocketFactory factory)
  throws IOException {   
    VersionedProtocol proxy =
        (VersionedProtocol) Proxy.newProxyInstance(
            protocol.getClassLoader(), new Class[] { protocol },
            new Invoker(addr, ticket, conf, factory));
    long serverVersion = proxy.getProtocolVersion(protocol.getName(),
                                                  clientVersion);
    if (serverVersion == clientVersion) {
      return proxy;
    }
    throw new VersionMismatch(protocol.getName(), clientVersion,
View Full Code Here

Examples of org.apache.hadoop.ipc.VersionedProtocol

   */
  public static VersionedProtocol getProxy(Class<?> protocol,
      long clientVersion, InetSocketAddress addr, UserGroupInformation ticket,
      Configuration conf, SocketFactory factory, int rpcTimeout)
  throws IOException {
    VersionedProtocol proxy =
        (VersionedProtocol) Proxy.newProxyInstance(
            protocol.getClassLoader(), new Class[] { protocol },
            new Invoker(addr, ticket, conf, factory, rpcTimeout));
    long serverVersion = proxy.getProtocolVersion(protocol.getName(),
                                                  clientVersion);
    if (serverVersion == clientVersion) {
      return proxy;
    }
    throw new VersionMismatch(protocol.getName(), clientVersion,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.