Package org.apache.accumulo.core.util

Examples of org.apache.accumulo.core.util.ServerServices


          System.exit(1);
        }
      }
    };
   
    byte[] lockContent = new ServerServices(addressString, Service.TSERV_CLIENT).toString().getBytes(Constants.UTF8);
    if (zlock.tryLock(lw, lockContent)) {
      log.debug("Obtained tablet server lock " + zlock.getLockPath());
    }
    // modify !METADATA
    synchronized (tch) {
View Full Code Here


      }
    };
   
    while (true) {
      lock = new ZooLock(path);
      if (lock.tryLock(lockWatcher, new ServerServices(address, Service.GC_CLIENT).toString().getBytes(Constants.UTF8))) {
        break;
      }
      UtilWaitThread.sleep(1000);
    }
  }
View Full Code Here

      String path = ZooUtil.getRoot(instance) + Constants.ZTSERVERS + "/" + tserver;
      byte[] data = ZooUtil.getLockData(zc, path);
      if (data != null) {
        String tserverData = new String(data, Constants.UTF8);
        if (!tserverData.equals("master")) {
          servers.add(new ThriftTransportKey(new ServerServices(tserverData).getAddressString(Service.TSERV_CLIENT), conf.getPort(Property.TSERV_CLIENTPORT),
              rpcTimeout));
        }
      }
    }
   
View Full Code Here

          });
         
        }
      };
     
      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes(Constants.UTF8);
      for (int i = 0; i < 120 / 5; i++) {
        zoo.putPersistentData(zPath, new byte[0], NodeExistsPolicy.SKIP);
       
        if (tabletServerLock.tryLock(lw, lockContent)) {
          log.debug("Obtained tablet server lock " + tabletServerLock.getLockPath());
View Full Code Here

        deleteServerNode(path + "/" + server);
        locklessServers.remove(server);
      }
    } else {
      locklessServers.remove(server);
      ServerServices services = new ServerServices(new String(lockData, Constants.UTF8));
      InetSocketAddress client = services.getAddress(ServerServices.Service.TSERV_CLIENT);
      InetSocketAddress addr = AddressUtil.parseAddress(server, Property.TSERV_CLIENTPORT);
      TServerInstance instance = new TServerInstance(client, stat.getEphemeralOwner());
     
      if (info == null) {
        updates.add(instance);
View Full Code Here

      String path = ZooUtil.getRoot(instance) + Constants.ZGC_LOCK;
      List<String> locks = zk.getChildren(path, null);
      if (locks != null && locks.size() > 0) {
        Collections.sort(locks);
        address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null), Constants.UTF8)).getAddress(Service.GC_CLIENT);
        GCMonitorService.Client client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, config.getConfiguration());
        try {
          result = client.getStatus(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
        } finally {
          ThriftUtil.returnClient(client);
View Full Code Here

        deleteServerNode(path + "/" + server);
        locklessServers.remove(server);
      }
    } else {
      locklessServers.remove(server);
      ServerServices services = new ServerServices(new String(lockData));
      InetSocketAddress client = services.getAddress(ServerServices.Service.TSERV_CLIENT);
      InetSocketAddress addr = AddressUtil.parseAddress(server, Property.TSERV_CLIENTPORT);
      TServerInstance instance = new TServerInstance(client, stat.getEphemeralOwner());
     
      if (info == null) {
        updates.add(instance);
View Full Code Here

      }
    };
   
    while (true) {
      lock = new ZooLock(path);
      if (lock.tryLock(lockWatcher, new ServerServices(address, Service.GC_CLIENT).toString().getBytes())) {
        break;
      }
      UtilWaitThread.sleep(1000);
    }
  }
View Full Code Here

      ZooReaderWriter zk = ZooReaderWriter.getInstance();
      String path = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZGC_LOCK;
      List<String> locks = zk.getChildren(path, null);
      if (locks != null && locks.size() > 0) {
        Collections.sort(locks);
        InetSocketAddress address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null))).getAddress(Service.GC_CLIENT);
        GCMonitorService.Iface client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, ServerConfiguration.getSystemConfiguration());
        try {
          result = client.getStatus(null, SecurityConstants.getSystemCredentials());
        } finally {
          ThriftUtil.returnClient(client);
View Full Code Here

          });

        }
      };

      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes();
      for (int i = 0; i < 120 / 5; i++) {
        zoo.putPersistentData(zPath, new byte[0], NodeExistsPolicy.SKIP);

        if (tabletServerLock.tryLock(lw, lockContent)) {
          log.debug("Obtained tablet server lock " + tabletServerLock.getLockPath());
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.util.ServerServices

Copyright © 2018 www.massapicom. 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.