public class MigrationUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MigrationUtils.ScrollCallback |
| Constructor and Description |
|---|
MigrationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildIndexCreationRequest(String baseIndexSettings,
String mapping,
MigrationContext context,
boolean isMonthlyIndex) |
static String |
buildIndexCreationRequestWithRollover(String baseIndexSettings,
String mapping,
MigrationContext context,
String lifeCycleName,
String rolloverAlias) |
static String |
buildRolloverPolicyCreationRequest(String baseRequest,
MigrationContext migrationContext) |
static void |
bulkUpdate(org.apache.http.impl.client.CloseableHttpClient httpClient,
String url,
String jsonData) |
static void |
cleanAllIndexWithRollover(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.osgi.framework.BundleContext bundleContext,
String esAddress,
String prefix,
String indexName) |
static org.json.JSONObject |
continueQueryWithScroll(org.apache.http.impl.client.CloseableHttpClient httpClient,
String url,
String scrollId) |
static void |
deleteIndex(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String indexName) |
static String |
extractMappingFromBundles(org.osgi.framework.BundleContext bundleContext,
String fileName) |
static String |
getFileWithoutComments(org.osgi.framework.BundleContext bundleContext,
String resource) |
static Set<String> |
getIndexesPrefixedBy(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String prefix) |
static boolean |
indexExists(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String indexName) |
static void |
moveToIndex(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.osgi.framework.BundleContext bundleContext,
String esAddress,
String sourceIndexName,
String targetIndexName,
String painlessScript) |
static org.json.JSONObject |
queryWithScroll(org.apache.http.impl.client.CloseableHttpClient httpClient,
String url) |
static void |
reIndex(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.osgi.framework.BundleContext bundleContext,
String esAddress,
String indexName,
String newIndexSettings,
String painlessScript,
MigrationContext migrationContext) |
static String |
resourceAsString(org.osgi.framework.BundleContext bundleContext,
String resource) |
static void |
scrollQuery(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String queryURL,
String query,
String scrollDuration,
MigrationUtils.ScrollCallback scrollCallback) |
static void |
waitForYellowStatus(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
MigrationContext migrationContext)
Utility method that waits for the ES cluster to be in yellow status
|
public static org.json.JSONObject queryWithScroll(org.apache.http.impl.client.CloseableHttpClient httpClient,
String url)
throws IOException
IOExceptionpublic static org.json.JSONObject continueQueryWithScroll(org.apache.http.impl.client.CloseableHttpClient httpClient,
String url,
String scrollId)
throws IOException
IOExceptionpublic static void bulkUpdate(org.apache.http.impl.client.CloseableHttpClient httpClient,
String url,
String jsonData)
throws IOException
IOExceptionpublic static String resourceAsString(org.osgi.framework.BundleContext bundleContext, String resource)
public static String getFileWithoutComments(org.osgi.framework.BundleContext bundleContext, String resource)
public static boolean indexExists(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String indexName)
throws IOException
IOExceptionpublic static Set<String> getIndexesPrefixedBy(org.apache.http.impl.client.CloseableHttpClient httpClient, String esAddress, String prefix) throws IOException
IOExceptionpublic static void cleanAllIndexWithRollover(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.osgi.framework.BundleContext bundleContext,
String esAddress,
String prefix,
String indexName)
throws IOException
IOExceptionpublic static String extractMappingFromBundles(org.osgi.framework.BundleContext bundleContext, String fileName) throws IOException
IOExceptionpublic static String buildIndexCreationRequest(String baseIndexSettings, String mapping, MigrationContext context, boolean isMonthlyIndex) throws IOException
IOExceptionpublic static String buildIndexCreationRequestWithRollover(String baseIndexSettings, String mapping, MigrationContext context, String lifeCycleName, String rolloverAlias) throws IOException
IOExceptionpublic static String buildRolloverPolicyCreationRequest(String baseRequest, MigrationContext migrationContext) throws IOException
IOExceptionpublic static void moveToIndex(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.osgi.framework.BundleContext bundleContext,
String esAddress,
String sourceIndexName,
String targetIndexName,
String painlessScript)
throws Exception
Exceptionpublic static void deleteIndex(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String indexName)
throws Exception
Exceptionpublic static void reIndex(org.apache.http.impl.client.CloseableHttpClient httpClient,
org.osgi.framework.BundleContext bundleContext,
String esAddress,
String indexName,
String newIndexSettings,
String painlessScript,
MigrationContext migrationContext)
throws Exception
Exceptionpublic static void scrollQuery(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
String queryURL,
String query,
String scrollDuration,
MigrationUtils.ScrollCallback scrollCallback)
throws IOException
IOExceptionpublic static void waitForYellowStatus(org.apache.http.impl.client.CloseableHttpClient httpClient,
String esAddress,
MigrationContext migrationContext)
throws Exception
ExceptionCopyright © 2014–2023 Apache Software Foundation. All rights reserved.