table replica elasticsearch autosetup

Maps a MapR-DB source binary table to an Elasticsearch type.

The type can already exist, as would be the case if custom mapping of MapR-DB data to Elasticsearch-supported data types is configured. If the type doesn't already exist, this command creates it and then loads data from the source table into the type.

The final action of this command is to start replication from the source table to the type.

The user that runs the command must have the following permissions granted through access control expressions on the source table:

  • Permission to perform column-family and column reads, which is granted with the readperm access control expression.
  • Permission to perform replication, which is granted with the replperm access control expression.
Note: The mapr user is not treated as a superuser. MapR-DB does not allow the mapr user to run this command unless that user is given the relevant permission or permissions with access-control expressions.

Syntax

CLI
maprcli table replica elasticsearch autosetup
-path source table path
-target Target cluster name
-index Elasticsearch index name
-type Elasticsearch type name
[ -conversionclass Conversion class name ]
[ -conversionjar Path to conversion class JAR file ]
[ -columns comma separated list of <family>[:<column>]
]
[ -throttle throttle replication ops. default: false ]
[ -networkencryption enable on-wire encryption. default: false
]
[ -networkcompression on-wire compression type:
off|on|lzf|lz4|zlib. default: on ]
REST

http[s]://<host>:<port>/rest/table/replica/elasticsearch/autosetup?path=<path>&target=<Name of Elasticsearch cluster>&index=<Name of index>&type=<Name of type to create>...

Parameters

Parameter

Description

path

The path to the new MapR-DB table.

  • For a path on the local cluster, start the path at the volume mount point. For example, for a table named test under a volume with a mount point at /volume1, specify the following path: /volume1/test
  • For a path on a remote cluster, you must also specify the cluster name in the path. For example, for a table named customer under volume1 in the sanfrancisco cluster, specify the following path: /mapr/sanfrancisco/volume1/customer

target

The name of the Elasticsearch cluster that you want to index data in. This name is the name specified for the cluster when it was registered with the current MapR cluster.

index

The name of the Elasticsearch index in which the type is located (if the type exists) or will be created (if it does not exist).

type

The name of the Elasticsearch type. Updates to the MapR-DB source table will be replicated to this type.

conversionclass

The name of the Java class that extends the MapR-provided interface MapRESConverter and specifies how to convert source data to Elasticsearch-supported data types that MapR-DB does not support. For more information about custom mapping of source data types to Elasticsearch-supported data types, see Converting Data to Elasticsearch Data Types That MapR-DB Does Not Support.

If use this parameter, you must also use the conversionjar parameter.

conversionjar

The path to the JAR file in which the class specified by the conversionclass parameter is located.

columns

A comma-separated list of column families and specific columns within column families. This list indicates which columns to replicate to the Elasticsearch type that is specified by the type parameter.

To replicate all columns within a column family, provide the name of the column family.

To replicate particular columns within a column family, provide the name of the column family and the name of the column. Separate the two with a colon.

For example, the following list causes the replication of all columns in the column family personal, all columns in the column family purchase, the number_of_stars column in the column family review, and the date column in the column family review:

-columns personal,purchase,review:number_of_stars,review:date

throttle

A Boolean value that specifies whether to throttle replication operations. Throttle the replication stream to minimize the impact of the replication process on incoming operations during periods of heavy load. The values are true or false. No throttle (false) is the default.

networkencryption

A Boolean value that specifies whether or not to enable on-wire encryption. The values are true or false. No encryption (false) is the default. If you set this to true, the source MapR cluster must be enabled for security.

Note: Data is encrypted only until it reaches a MapR gateway. From the gateway to an Elasticsearch cluster, this parameter has no effect.

networkcompression

The type of on-wire compression.

The types are:

  • off
  • on (default)
  • lzf
  • lz4
  • zlib

lz4 is the default compression which it set by the parameter values on and lz4.

Note: Data is compressed only until it reaches a MapR gateway. From the gateway to an Elasticsearch cluster, this parameter has no effect.