@Test(expected = IllegalArgumentException.class) public void swapIndexInAliasNullIndexTest() { EsIndex.swapIndexInAliases(EsConfig.from(DUMMY_HOST), Collections.singleton("alias"), null); thrown.expectMessage("index is required"); }
public static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index) { Preconditions.checkArgument(aliases != null && !aliases.isEmpty(), "alias is required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(index), "index is required"); swapIndexInAliases( config, aliases, index, Collections.emptySet(), Searching.getDefaultSearchSettings()); }
EsIndex { public static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index) { Preconditions.checkArgument(aliases != null && !aliases.isEmpty(), "alias is required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(index), "index is required"); swapIndexInAliases( config, aliases, index, Collections.emptySet(), Searching.getDefaultSearchSettings()); } }
EsIndex { public static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index) { Preconditions.checkArgument(aliases != null && !aliases.isEmpty(), "alias is required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(index), "index is required"); swapIndexInAliases( config, aliases, index, Collections.emptySet(), Searching.getDefaultSearchSettings()); }  }
EsIndex { public static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index) { Preconditions.checkArgument(aliases != null && !aliases.isEmpty(), "alias is required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(index), "index is required"); swapIndexInAliases( config, aliases, index, Collections.emptySet(), Searching.getDefaultSearchSettings()); }  static String createIndex(EsConfig config, IndexParams indexParams); static Optional<String> createIndexIfNotExists(EsConfig config, IndexParams indexParams); static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index); static void swapIndexInAliases(
      EsConfig config,
      Set<String> aliases,
      String index,
      Set<String> extraIdxToRemove,
      Map<String, String> settings); static long countDocuments(EsConfig config, String index); static Set<String> deleteRecordsByDatasetId(
      EsConfig config,
      String[] aliases,
      String datasetKey,
      Predicate<String> indexesToDelete,
      int timeoutSec,
      int attempts); static Set<String> findDatasetIndexesInAliases(
      EsConfig config, String[] aliases, String datasetKey); }
EsIndex { public static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index) { Preconditions.checkArgument(aliases != null && !aliases.isEmpty(), "alias is required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(index), "index is required"); swapIndexInAliases( config, aliases, index, Collections.emptySet(), Searching.getDefaultSearchSettings()); }  static String createIndex(EsConfig config, IndexParams indexParams); static Optional<String> createIndexIfNotExists(EsConfig config, IndexParams indexParams); static void swapIndexInAliases(EsConfig config, Set<String> aliases, String index); static void swapIndexInAliases(
      EsConfig config,
      Set<String> aliases,
      String index,
      Set<String> extraIdxToRemove,
      Map<String, String> settings); static long countDocuments(EsConfig config, String index); static Set<String> deleteRecordsByDatasetId(
      EsConfig config,
      String[] aliases,
      String datasetKey,
      Predicate<String> indexesToDelete,
      int timeoutSec,
      int attempts); static Set<String> findDatasetIndexesInAliases(
      EsConfig config, String[] aliases, String datasetKey);  }