Package com.splunk

Examples of com.splunk.Service


  /**
   * @return
   */
  public static String getIndexNameForBucketDir(File bucketDir) {
    Service splunkService = getSplunkService();
    return IndexScanner.getIndexNameByBucketPath(bucketDir, splunkService);
  }
View Full Code Here


    this.shuttlPort = Integer.parseInt(shuttlPort);
    archiveConfiguration = ArchiveConfiguration.getSharedInstance();
    thawIndex = TUtilsEndToEnd.REAL_SPLUNK_INDEX;
    tempDirectory = createDirectory();

    Service service = TUtilsEndToEnd.getLoggedInService(splunkHost, splunkPort,
        splunkUserName, splunkPw);
    assertTrue(service.getIndexes().containsKey(thawIndex));
    splunkIndexesLayer = new SplunkIndexesLayer(service);

    try {
      thawDirectoryLocation = splunkIndexesLayer.getThawLocation(thawIndex);
      thawDirectoryLocation.mkdirs();
View Full Code Here

public class ShuttlPortEndpointTest {

  @Parameters(value = { "splunk.host", "splunk.mgmtport", "shuttl.port" })
  public void getShuttlPort_givenSplunkIndexer_getsShuttlPort(
      String splunkHost, String splunkPort, String shuttlPort) {
    Service service = new Service(splunkHost, Integer.parseInt(splunkPort));
    ShuttlPortEndpoint shuttlPortEntity = ShuttlPortEndpoint.create(service);

    int actualShuttlPort = shuttlPortEntity.getShuttlPort();

    assertEquals(actualShuttlPort, Integer.parseInt(shuttlPort));
View Full Code Here

  private void runClusterArchivingTest(String slave1Host, String slave1Port,
      String slave2Host, String slave2Port, String slave2ShuttlPort,
      String splunkUser, String splunkPass, final String splunkHome,
      ReplicatedBucketProvider replicatedBucketProvider,
      final ArchivePathAsserter archivePathAsserter) {
    Service slave1 = TUtilsEndToEnd.getLoggedInService(slave1Host, slave1Port,
        splunkUser, splunkPass);
    Service slave2 = TUtilsEndToEnd.getLoggedInService(slave2Host, slave2Port,
        splunkUser, splunkPass);

    assertTrue(slave2.getIndexes().containsKey(index));
    String coldPathExpanded = slave2.getIndexes().get(index)
        .getColdPathExpanded();

    String slave1Guid = slave1.getInfo().getGuid();

    final LocalBucket rb = replicatedBucketProvider.create(coldPathExpanded,
View Full Code Here

    TUtilsEndToEnd.cleanHadoopFileSystem(shuttlConfDir, splunkHome);
  }

  public static LocalBucket putBucketInPeerThawDirectory(String splunkHost,
      String splunkPort, String splunkUser, String splunkPass, String index) {
    Service service = TUtilsEndToEnd.getLoggedInService(splunkHost, splunkPort,
        splunkUser, splunkPass);
    File thawDirectory = new File(service.getIndexes().get(index)
        .getThawedPathExpanded());
    return TUtilsBucket.createBucketInDirectoryWithIndex(thawDirectory, index);
  }
View Full Code Here

        splunkPass);
  }

  public static Service getLoggedInService(String host, int port,
      String splunkUser, String splunkPass) {
    Service masterService = new Service(host, port);
    masterService.login(splunkUser, splunkPass);
    return masterService;
  }
View Full Code Here

    this.splunkHome = splunkHome;
  }

  @Override
  public void copyBucket(LocalBucket bucket) {
    Service splunkService = SplunkIndexedLayerFactory
        .getLoggedInSplunkService();
    Index index = splunkService.getIndexes().get(bucket.getIndex());
    File indexColdDir = new File(index.getColdPathExpanded());
    assertTrue(indexColdDir.exists());

    File copyScript = getCopyScript();
    File movedBucketDirectory = createDirectoryInParent(indexColdDir,
View Full Code Here

  /**
   * @return {@link Service} that returns a thawLocationPath for indexName.
   */
  public static Service createSplunkServiceReturningThawPathForIndex(
      String indexName, String thawLocationPath) {
    Service splunkService = mock(Service.class);
    IndexCollection indexesMock = mock(IndexCollection.class);
    Index indexMock = mock(Index.class);

    when(splunkService.getIndexes()).thenReturn(indexesMock);
    when(indexesMock.get(indexName)).thenReturn(indexMock);
    when(indexMock.getThawedPathExpanded()).thenReturn(thawLocationPath);
    return splunkService;
  }
View Full Code Here

    TUtilsMBean.runWithRegisteredMBeans(new File(shuttlConfDir),
        new Runnable() {

          @Override
          public void run() {
            Service service = SplunkIndexedLayerFactory
                .getLoggedInSplunkService();
            String index = TUtilsEndToEnd.REAL_SPLUNK_INDEX;
            assertTrue(service.getIndexes().containsKey(index));
            LocalBucket bucket = TUtilsBucket.createBucketInDirectoryWithIndex(
                createDirectory(), index);
            assertTrue(service.getIndexes().containsKey(bucket.getIndex()));

            bucketCopier.copyBucket(bucket);
            assertTrue(bucket.getDirectory().exists());

            assertBucketWasCopiedToArchiveFileSystem_withTeardown(bucket);
View Full Code Here

TOP

Related Classes of com.splunk.Service

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.