Package com.splunk

Examples of com.splunk.ClusterPeers


        "Could not get cluster master uri from splunk indexer: "
            + clusterConfig.getService().getHost());
  }

  private ClusterPeer getClusterPeerChecked(String guid, URI clusterMasterUri) {
    ClusterPeers clusterPeers = peersProvider.getClusterPeers(clusterMasterUri);
    ClusterPeer clusterPeer = clusterPeers.get(guid);
    if (clusterPeer == null)
      throwClusterPeersException(guid, clusterPeers);
    return clusterPeer;
  }
View Full Code Here


  }

  public ClusterPeers getClusterPeers(URI masterUri) {
    Service service = new Service(masterUri.getHost(), masterUri.getPort());
    service.login(mBeanProxy.getUsername(), mBeanProxy.getPassword());
    return new ClusterPeers(service);
  }
View Full Code Here

    String host = "host";
    int port = 1234;
    URI masterUri = URI.create("https://" + host + ":" + port);

    when(clusterConfig.getClusterMasterUri()).thenReturn(masterUri);
    ClusterPeers clusterPeers = mock(ClusterPeers.class);
    when(peersProvider.getClusterPeers(masterUri)).thenReturn(clusterPeers);
    ClusterPeer clusterPeer = mock(ClusterPeer.class);
    when(clusterPeers.get(guid)).thenReturn(clusterPeer);
    when(clusterPeer.getHost()).thenReturn(host);
    when(clusterPeer.getPort()).thenReturn(port);

    IndexerInfo indexer = clusterMaster.indexerForGuid(guid);
    assertEquals(indexer, new IndexerInfo(host, port));
View Full Code Here

  @Test(expectedExceptions = { ClusterPeersException.class })
  public void getIndexerForGuid_clusterPeersReturnsNull_throws() {
    stubNonNullClusterMasterUriToAvoidClusterConfigException();

    ClusterPeers clusterPeers = mock(ClusterPeers.class);
    stubSplunkServiceForExceptionMessage(clusterPeers);
    when(peersProvider.getClusterPeers(any(URI.class)))
        .thenReturn(clusterPeers);

    when(clusterPeers.get(guid)).thenReturn(null);
    clusterMaster.indexerForGuid(guid);
  }
View Full Code Here

TOP

Related Classes of com.splunk.ClusterPeers

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.