public class BulkNodeClient extends Object implements Ingest
| Constructor and Description |
|---|
BulkNodeClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSetting(String key,
Boolean value)
Create a key/value in the settings
|
void |
addSetting(String key,
Integer value)
Create a key/value in the settings
|
void |
addSetting(String key,
String value)
Create a key/value in the settings
|
BulkNodeClient |
bulkDelete(org.elasticsearch.action.delete.DeleteRequest deleteRequest)
Bulked delete request.
|
BulkNodeClient |
bulkIndex(org.elasticsearch.action.index.IndexRequest indexRequest)
Bulked index request.
|
org.elasticsearch.client.Client |
client() |
BulkNodeClient |
delete(String index,
String type,
String id)
Delete document
|
BulkNodeClient |
deleteIndex(String index)
Delete index
|
BulkNodeClient |
deleteMapping(String index,
String type) |
BulkNodeClient |
flush(String index)
Flush the index
|
BulkNodeClient |
flushIngest()
Flush ingest, move all pending documents to the bulk indexer
|
BulkNodeClient |
flushIngestInterval(org.elasticsearch.common.unit.TimeValue flushInterval)
Set the flush interval for automatic flushing outstanding ingest requests
|
List<String> |
getConnectedNodes() |
Map<String,String> |
getMappings() |
Metric |
getMetric() |
org.elasticsearch.common.settings.Settings |
getSettings() |
org.elasticsearch.common.settings.ImmutableSettings.Builder |
getSettingsBuilder() |
Throwable |
getThrowable()
Return last throwable if exists.
|
boolean |
hasThrowable() |
BulkNodeClient |
index(String index,
String type,
String id,
String source)
Index document
|
boolean |
isShutdown() |
void |
mapping(String type,
InputStream in) |
void |
mapping(String type,
String mapping) |
BulkNodeClient |
maxActionsPerBulkRequest(int maxActionsPerBulkRequest)
Set the maximum number of actions per bulk request
|
BulkNodeClient |
maxConcurrentBulkRequests(int maxConcurrentBulkRequests)
Set the maximum concurent bulk requests
|
BulkNodeClient |
maxRequestWait(org.elasticsearch.common.unit.TimeValue timeValue)
Set request timeout.
|
BulkNodeClient |
maxVolumePerBulkRequest(org.elasticsearch.common.unit.ByteSizeValue maxVolume)
Set the maximum volume for bulk request before flush
|
BulkNodeClient |
newClient(org.elasticsearch.client.Client client) |
BulkNodeClient |
newClient(Map<String,String> client) |
BulkNodeClient |
newClient(org.elasticsearch.common.settings.Settings settings) |
BulkNodeClient |
newIndex(String index)
Create a new index
|
BulkNodeClient |
newIndex(String index,
org.elasticsearch.common.settings.Settings settings,
Map<String,String> mappings) |
BulkNodeClient |
newIndex(String index,
String type,
InputStream settings,
InputStream mappings) |
BulkNodeClient |
putMapping(String index) |
BulkNodeClient |
refresh(String index)
Refresh the index.
|
BulkNodeClient |
replica(int replica)
The number of replica for index creation
|
void |
resume() |
void |
setSettings(org.elasticsearch.common.settings.Settings settings) |
void |
setting(InputStream in)
Create settings
|
BulkNodeClient |
shards(int shards)
The number of shards for index creation
|
void |
shutdown()
Shutdown the ingesting
|
BulkNodeClient |
startBulk(String index)
Start bulk mode
|
BulkNodeClient |
stopBulk(String index)
Stops bulk mode.
|
void |
suspend() |
int |
updateReplicaLevel(String index,
int level)
Add replica level.
|
BulkNodeClient |
waitForCluster(org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus status,
org.elasticsearch.common.unit.TimeValue timeout)
Wait for cluster being healthy.
|
int |
waitForRecovery(String index)
Wait for index recovery (after replica change)
|
BulkNodeClient |
waitForResponses(org.elasticsearch.common.unit.TimeValue maxWaitTime)
Wait for all outstanding responses
|
public BulkNodeClient()
public BulkNodeClient shards(int shards)
Ingestpublic BulkNodeClient replica(int replica)
Ingestpublic BulkNodeClient maxActionsPerBulkRequest(int maxActionsPerBulkRequest)
IngestmaxActionsPerBulkRequest in interface IngestmaxActionsPerBulkRequest - maximum number of bulk actionspublic BulkNodeClient maxConcurrentBulkRequests(int maxConcurrentBulkRequests)
IngestmaxConcurrentBulkRequests in interface IngestmaxConcurrentBulkRequests - maximum number of concurrent ingest requestspublic BulkNodeClient maxVolumePerBulkRequest(org.elasticsearch.common.unit.ByteSizeValue maxVolume)
IngestmaxVolumePerBulkRequest in interface IngestmaxVolume - maximum volumepublic BulkNodeClient maxRequestWait(org.elasticsearch.common.unit.TimeValue timeValue)
IngestmaxRequestWait in interface IngesttimeValue - timeoutpublic BulkNodeClient flushIngestInterval(org.elasticsearch.common.unit.TimeValue flushInterval)
IngestflushIngestInterval in interface IngestflushInterval - the flush interval, default is 30 secondspublic BulkNodeClient newClient(org.elasticsearch.common.settings.Settings settings)
public BulkNodeClient newClient(Map<String,String> client)
public List<String> getConnectedNodes()
getConnectedNodes in interface Ingestpublic BulkNodeClient newClient(org.elasticsearch.client.Client client)
public BulkNodeClient putMapping(String index)
putMapping in interface Ingestpublic BulkNodeClient deleteMapping(String index, String type)
deleteMapping in interface Ingestpublic BulkNodeClient index(String index, String type, String id, String source)
Ingestpublic BulkNodeClient bulkIndex(org.elasticsearch.action.index.IndexRequest indexRequest)
Ingestpublic BulkNodeClient delete(String index, String type, String id)
Ingestpublic BulkNodeClient bulkDelete(org.elasticsearch.action.delete.DeleteRequest deleteRequest)
IngestbulkDelete in interface IngestdeleteRequest - the delete request to addpublic BulkNodeClient flushIngest()
IngestflushIngest in interface Ingestpublic BulkNodeClient waitForResponses(org.elasticsearch.common.unit.TimeValue maxWaitTime) throws InterruptedException
IngestwaitForResponses in interface IngestmaxWaitTime - maximum wait timeInterruptedExceptionpublic BulkNodeClient startBulk(String index) throws IOException
IngeststartBulk in interface IngestIOExceptionpublic BulkNodeClient stopBulk(String index) throws IOException
IngeststopBulk in interface IngestIOExceptionpublic BulkNodeClient flush(String index)
Ingestpublic BulkNodeClient refresh(String index)
Ingestpublic int updateReplicaLevel(String index, int level) throws IOException
IngestupdateReplicaLevel in interface Ingestlevel - the replica levelIOExceptionpublic BulkNodeClient waitForCluster(org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus status, org.elasticsearch.common.unit.TimeValue timeout) throws IOException
IngestwaitForCluster in interface IngestIOExceptionpublic int waitForRecovery(String index) throws IOException
IngestwaitForRecovery in interface IngestIOExceptionpublic boolean isShutdown()
isShutdown in interface Ingestpublic BulkNodeClient newIndex(String index) throws IOException
IngestnewIndex in interface IngestIOExceptionpublic BulkNodeClient newIndex(String index, String type, InputStream settings, InputStream mappings) throws IOException
newIndex in interface IngestIOExceptionpublic BulkNodeClient newIndex(String index, org.elasticsearch.common.settings.Settings settings, Map<String,String> mappings) throws IOException
newIndex in interface IngestIOExceptionpublic BulkNodeClient deleteIndex(String index)
IngestdeleteIndex in interface Ingestpublic boolean hasThrowable()
hasThrowable in interface Ingestpublic Throwable getThrowable()
IngestgetThrowable in interface Ingestpublic void setSettings(org.elasticsearch.common.settings.Settings settings)
setSettings in interface Ingestpublic org.elasticsearch.common.settings.Settings getSettings()
getSettings in interface Ingestpublic org.elasticsearch.common.settings.ImmutableSettings.Builder getSettingsBuilder()
getSettingsBuilder in interface Ingestpublic void setting(InputStream in) throws IOException
Ingestsetting in interface Ingestin - the input stream with settingsIOExceptionpublic void addSetting(String key, String value)
IngestaddSetting in interface Ingestkey - the keyvalue - the valuepublic void addSetting(String key, Boolean value)
IngestaddSetting in interface Ingestkey - the keyvalue - the valuepublic void addSetting(String key, Integer value)
IngestaddSetting in interface Ingestkey - the keyvalue - the valuepublic void mapping(String type, InputStream in) throws IOException
mapping in interface IngestIOExceptionpublic void mapping(String type, String mapping) throws IOException
mapping in interface IngestIOExceptionpublic Map<String,String> getMappings()
getMappings in interface Ingestelasticsearch-river-jdbc