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)
Ingest
public BulkNodeClient replica(int replica)
Ingest
public BulkNodeClient maxActionsPerBulkRequest(int maxActionsPerBulkRequest)
Ingest
maxActionsPerBulkRequest
in interface Ingest
maxActionsPerBulkRequest
- maximum number of bulk actionspublic BulkNodeClient maxConcurrentBulkRequests(int maxConcurrentBulkRequests)
Ingest
maxConcurrentBulkRequests
in interface Ingest
maxConcurrentBulkRequests
- maximum number of concurrent ingest requestspublic BulkNodeClient maxVolumePerBulkRequest(org.elasticsearch.common.unit.ByteSizeValue maxVolume)
Ingest
maxVolumePerBulkRequest
in interface Ingest
maxVolume
- maximum volumepublic BulkNodeClient maxRequestWait(org.elasticsearch.common.unit.TimeValue timeValue)
Ingest
maxRequestWait
in interface Ingest
timeValue
- timeoutpublic BulkNodeClient flushIngestInterval(org.elasticsearch.common.unit.TimeValue flushInterval)
Ingest
flushIngestInterval
in interface Ingest
flushInterval
- 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 Ingest
public BulkNodeClient newClient(org.elasticsearch.client.Client client)
public BulkNodeClient putMapping(String index)
putMapping
in interface Ingest
public BulkNodeClient deleteMapping(String index, String type)
deleteMapping
in interface Ingest
public BulkNodeClient index(String index, String type, String id, String source)
Ingest
public BulkNodeClient bulkIndex(org.elasticsearch.action.index.IndexRequest indexRequest)
Ingest
public BulkNodeClient delete(String index, String type, String id)
Ingest
public BulkNodeClient bulkDelete(org.elasticsearch.action.delete.DeleteRequest deleteRequest)
Ingest
bulkDelete
in interface Ingest
deleteRequest
- the delete request to addpublic BulkNodeClient flushIngest()
Ingest
flushIngest
in interface Ingest
public BulkNodeClient waitForResponses(org.elasticsearch.common.unit.TimeValue maxWaitTime) throws InterruptedException
Ingest
waitForResponses
in interface Ingest
maxWaitTime
- maximum wait timeInterruptedException
public BulkNodeClient startBulk(String index) throws IOException
Ingest
startBulk
in interface Ingest
IOException
public BulkNodeClient stopBulk(String index) throws IOException
Ingest
stopBulk
in interface Ingest
IOException
public BulkNodeClient flush(String index)
Ingest
public BulkNodeClient refresh(String index)
Ingest
public int updateReplicaLevel(String index, int level) throws IOException
Ingest
updateReplicaLevel
in interface Ingest
level
- the replica levelIOException
public BulkNodeClient waitForCluster(org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus status, org.elasticsearch.common.unit.TimeValue timeout) throws IOException
Ingest
waitForCluster
in interface Ingest
IOException
public int waitForRecovery(String index) throws IOException
Ingest
waitForRecovery
in interface Ingest
IOException
public boolean isShutdown()
isShutdown
in interface Ingest
public BulkNodeClient newIndex(String index) throws IOException
Ingest
newIndex
in interface Ingest
IOException
public BulkNodeClient newIndex(String index, String type, InputStream settings, InputStream mappings) throws IOException
newIndex
in interface Ingest
IOException
public BulkNodeClient newIndex(String index, org.elasticsearch.common.settings.Settings settings, Map<String,String> mappings) throws IOException
newIndex
in interface Ingest
IOException
public BulkNodeClient deleteIndex(String index)
Ingest
deleteIndex
in interface Ingest
public boolean hasThrowable()
hasThrowable
in interface Ingest
public Throwable getThrowable()
Ingest
getThrowable
in interface Ingest
public void setSettings(org.elasticsearch.common.settings.Settings settings)
setSettings
in interface Ingest
public org.elasticsearch.common.settings.Settings getSettings()
getSettings
in interface Ingest
public org.elasticsearch.common.settings.ImmutableSettings.Builder getSettingsBuilder()
getSettingsBuilder
in interface Ingest
public void setting(InputStream in) throws IOException
Ingest
setting
in interface Ingest
in
- the input stream with settingsIOException
public void addSetting(String key, String value)
Ingest
addSetting
in interface Ingest
key
- the keyvalue
- the valuepublic void addSetting(String key, Boolean value)
Ingest
addSetting
in interface Ingest
key
- the keyvalue
- the valuepublic void addSetting(String key, Integer value)
Ingest
addSetting
in interface Ingest
key
- the keyvalue
- the valuepublic void mapping(String type, InputStream in) throws IOException
mapping
in interface Ingest
IOException
public void mapping(String type, String mapping) throws IOException
mapping
in interface Ingest
IOException
public Map<String,String> getMappings()
getMappings
in interface Ingest
elasticsearch-river-jdbc