Package com.splunk

Examples of com.splunk.Index


    List<File> paths = indexPaths.getDbPathsForIndex("some-index");
    assertEquals(paths, Collections.emptyList());
  }

  public void getDbPathsForIndex_indexWithHomePath_listContainingHomePath() {
    Index index = mock(Index.class);
    File homePath = createFilePath();
    when(index.getHomePathExpanded()).thenReturn(homePath.getAbsolutePath());

    assert_getDbPathsForIndex_containsDbPath(index, homePath);
  }
View Full Code Here


    assertEquals(paths.size(), 1);
    assertEquals(paths.get(0).getAbsolutePath(), dbPath.getAbsolutePath());
  }

  public void getDbPathsForIndex_indexWithColdPath_listContainingColdPath() {
    Index index = mock(Index.class);
    File coldPath = createFilePath();
    when(index.getColdPathExpanded()).thenReturn(coldPath.getAbsolutePath());

    assert_getDbPathsForIndex_containsDbPath(index, coldPath);
  }
View Full Code Here

    assert_getDbPathsForIndex_containsDbPath(index, coldPath);
  }

  public void getDbPathsForIndex_indexWithThawPath_listContainingThawPath() {
    Index index = mock(Index.class);
    File thawPath = createFilePath();
    when(index.getThawedPathExpanded()).thenReturn(thawPath.getAbsolutePath());

    assert_getDbPathsForIndex_containsDbPath(index, thawPath);
  }
View Full Code Here

  }

  private String stubSplunkIndexColdPath(String index) {
    IndexCollection indexes = mock(IndexCollection.class);
    when(splunkService.getIndexes()).thenReturn(indexes);
    Index splunkIndex = mock(Index.class);
    when(indexes.get(index)).thenReturn(splunkIndex);
    String coldPath = "/cold/path";
    when(splunkIndex.getColdPathExpanded()).thenReturn(coldPath);
    return coldPath;
  }
View Full Code Here

        + indexedEventCount;
    throw new RuntimeException(msg);
  }

  public static Index createSplunkIndex(Service service, String name) {
    Index index;
    EntityCollection<Index> indexes = service.getIndexes();
    if (indexes.containsKey(name)) {
      System.out.println("Index " + name + " already exists");
      index = indexes.get(name);
    } else {
      indexes.create(name);
      index = indexes.get(name);
      index.refresh();
      indexes.refresh();
      System.out.println("Index " + name + " created");
    }

    return index;
View Full Code Here

  @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,
        bucket.getName());
View Full Code Here

    setupThawPathForAllIndexes(indexes);
    return indexes;
  }

  private void setupThawPathForAllIndexes(Map<String, Index> indexes) {
    Index anyIndex = mock(Index.class);
    when(indexes.get(anyString())).thenReturn(anyIndex);
    when(anyIndex.getThawedPathExpanded()).thenReturn(
        thawLocation.getAbsolutePath());
  }
View Full Code Here

   */
  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

TOP

Related Classes of com.splunk.Index

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.