Examples of ServerServices


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

      }
    };
   
    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

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

          if (info == null) {
            // Yep: hold onto the information about this server
            byte[] lockData = ZooLock.getLockData(lockPath);
            String lockString = new String(lockData == null ? new byte[] {} : lockData);
            if (lockString.length() > 0 && !lockString.equals("master")) {
              ServerServices services = new ServerServices(new String(lockData));
              InetSocketAddress client = services.getAddress(ServerServices.Service.TSERV_CLIENT);
              InetSocketAddress addr = AddressUtil.parseAddress(server, Property.TSERV_CLIENTPORT);
              TServerConnection conn = new TServerConnection(addr);
              instance = new TServerInstance(client, lock.getSessionId());
              info = new TServerInfo(lock, instance, conn, watcher);
              current.put(server, info);
View Full Code Here

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

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

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

            // Yep: hold onto the information about this server
            Stat stat = new Stat();
            byte[] lockData = ZooLock.getLockData(lockPath, stat);
            String lockString = new String(lockData == null ? new byte[] {} : lockData);
            if (lockString.length() > 0 && !lockString.equals("master")) {
              ServerServices services = new ServerServices(new String(lockData));
              InetSocketAddress client = services.getAddress(ServerServices.Service.TSERV_CLIENT);
              InetSocketAddress addr = AddressUtil.parseAddress(server, Property.TSERV_CLIENTPORT);
              TServerConnection conn = new TServerConnection(addr);
              instance = new TServerInstance(client, stat.getEphemeralOwner());
              info = new TServerInfo(lock, instance, conn, watcher);
              current.put(server, info);
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

    @BeforeMethod
    public void beforeMethod() {
        opResults = new Hashtable<String, Object>(); // need synchronized hashtable
        jobsCompleted = Collections.synchronizedMap(new TreeMap<String, Long>());

        ServerServices serverServices = new ServerServices();
        serverServices.setOperationServerService(new MockOperationServerService());

        pcConfig = new PluginContainerConfiguration();
        pcConfig.setOperationInvocationTimeout(5);
        pcConfig.setServerServices(serverServices);
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

    @BeforeMethod
    public void beforeMethod() {
        opResults = new Hashtable<String, Object>(); // need synchronized hashtable
        jobsCompleted = Collections.synchronizedMap(new TreeMap<String, Long>());

        ServerServices serverServices = new ServerServices();
        serverServices.setOperationServerService(new MockOperationServerService());

        pcConfig = new PluginContainerConfiguration();
        pcConfig.setOperationInvocationTimeout(OPERATION_TIMEOUT_MILLIS / 1000L);
        pcConfig.setServerServices(serverServices);
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

        final ConfigManagement configMgmt = context.mock(ConfigManagement.class);

        final ConfigurationServerService configServerService = context.mock(ConfigurationServerService.class);

        ServerServices serverServices = new ServerServices();
        serverServices.setConfigurationServerService(configServerService);

        final UpdateResourceConfigurationRunner updateRunner = new UpdateResourceConfigurationRunner(
            configServerService, resourceType, configMgmt, request);

        context.checking(new Expectations() {
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

    }

    public void mergeResourcesFromUpgrade(Set<ResourceUpgradeRequest> upgradeRequests) throws Exception {
        Set<ResourceUpgradeResponse> serverUpdates = null;
        try {
            ServerServices serverServices = this.configuration.getServerServices();
            if (serverServices != null) {
                DiscoveryServerService discoveryServerService = serverServices.getDiscoveryServerService();

                serverUpdates = discoveryServerService.upgradeResources(upgradeRequests);
            }
        } catch (Exception e) {
            log.error("Failed to process resource upgrades on the server.", e);
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

        return false;
    }

    private boolean mergeExistingResourceVersionOnServer(Resource resource, String newVersion) {
        boolean versionUpdated = false;
        ServerServices serverServices = this.configuration.getServerServices();
        if (serverServices != null) {
            try {
                DiscoveryServerService discoveryServerService = serverServices.getDiscoveryServerService();
                discoveryServerService.updateResourceVersion(resource.getId(), newVersion);
                // Only update the version in local inventory if the server sync succeeded, otherwise we won't know
                // to try again the next time this method is called.
                versionUpdated = true;
                if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

    private Configuration mergeExistingResourcePluginConfigurationOnServer(Resource resource,
        Configuration updatedPluginConfig) {

        Configuration result = null;
        ServerServices serverServices = this.configuration.getServerServices();

        if (serverServices != null) {
            try {
                ConfigurationServerService configServerService = serverServices.getConfigurationServerService();
                result = configServerService.persistUpdatedPluginConfiguration(resource.getId(), updatedPluginConfig);
            } catch (Exception e) {
                log.error("Failed to sync-to-Server new plugin configuration for [" + resource + "]");
            }
        } else {
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.