@InputRequirement(value=INPUT_REQUIRED) @EventDriven @SupportsBatching @Tags(value={"rethinkdb","stream","insert","update","write","put"}) @CapabilityDescription(value="Processor to write the JSON content of a FlowFile to RethinkDB (https://www.rethinkdb.com/). The flow file should contain either JSON Object an array of JSON documents") @WritesAttribute(attribute="rethinkdb.error.message",description="RethinkDB error message") @WritesAttribute(attribute="rethinkdb.insert.errors",description="Error count while inserting documents") @WritesAttribute(attribute="rethinkdb.insert.deleted",description="Number of documents deleted") @WritesAttribute(attribute="rethinkdb.insert.generated_keys",description="Keys generated on inserting documents") @WritesAttribute(attribute="rethinkdb.insert.inserted",description="Number of documents inserted") @WritesAttribute(attribute="rethinkdb.insert.replaced",description="Number of documents replaced") @WritesAttribute(attribute="rethinkdb.insert.skipped",description="Number of documents skipped because they already existed") @WritesAttribute(attribute="rethinkdb.insert.unchanged",description="Number of documents unchanged since they already existed") @WritesAttribute(attribute="rethinkdb.insert.first_error",description="First error while inserting documents") @WritesAttribute(attribute="rethinkdb.insert.warnings",description="Warning message in case of large number of ids being returned on insertion") @SeeAlso(value={GetRethinkDB.class,DeleteRethinkDB.class}) public class PutRethinkDB extends AbstractProcessor
Constructor and Description |
---|
PutRethinkDB() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown client connection
|
protected com.rethinkdb.gen.ast.Table |
getRdbTable() |
java.util.Set<Relationship> |
getRelationships() |
protected com.rethinkdb.RethinkDB |
getRethinkDB()
Helper method to help testability
|
java.util.List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Allows subclasses to register which property descriptor objects are
supported.
|
protected com.rethinkdb.net.Connection |
makeConnection() |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
protected java.util.HashMap<java.lang.String,java.lang.Object> |
runInsert(com.rethinkdb.gen.ast.Insert insert) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static AllowableValue CONFLICT_STRATEGY_UPDATE
public static AllowableValue CONFLICT_STRATEGY_REPLACE
public static AllowableValue CONFLICT_STRATEGY_ERROR
protected static final PropertyDescriptor CONFLICT_STRATEGY
public static final java.lang.String RETHINKDB_INSERT_RESULT
public static final java.lang.String RETHINKDB_INSERT_RESULT_ERROR_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_DELETED_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_GENERATED_KEYS_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_INSERTED_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_REPLACED_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_SKIPPED_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_UNCHANGED_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_FIRST_ERROR_KEY
public static final java.lang.String RETHINKDB_INSERT_RESULT_WARNINGS_KEY
public final java.lang.String CONFLICT_OPTION_KEY
protected static final PropertyDescriptor CHARSET
public static final PropertyDescriptor DB_NAME
public static final PropertyDescriptor DB_HOST
public static final PropertyDescriptor DB_PORT
public static final PropertyDescriptor USERNAME
public static final PropertyDescriptor PASSWORD
public static final PropertyDescriptor TABLE_NAME
protected static final PropertyDescriptor MAX_DOCUMENTS_SIZE
public static final PropertyDescriptor RETHINKDB_DOCUMENT_ID
public static AllowableValue DURABILITY_SOFT
public static AllowableValue DURABILITY_HARD
protected static final PropertyDescriptor DURABILITY
public static final java.lang.String RESULT_ERROR_KEY
public static final java.lang.String RESULT_DELETED_KEY
public static final java.lang.String RESULT_GENERATED_KEYS_KEY
public static final java.lang.String RESULT_INSERTED_KEY
public static final java.lang.String RESULT_REPLACED_KEY
public static final java.lang.String RESULT_SKIPPED_KEY
public static final java.lang.String RESULT_UNCHANGED_KEY
public static final java.lang.String RESULT_FIRST_ERROR_KEY
public static final java.lang.String RESULT_WARNINGS_KEY
public static final java.lang.String DURABILITY_OPTION_KEY
public static final java.lang.String RETHINKDB_ERROR_MESSAGE
public static final java.lang.String DOCUMENT_ID_EMPTY_MESSAGE
protected com.rethinkdb.net.Connection rethinkDbConnection
protected java.lang.String databaseName
protected java.lang.String tableName
protected java.lang.String username
protected java.lang.String password
protected java.lang.String hostname
protected java.lang.Integer port
protected long maxDocumentsSize
public java.util.Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public final java.util.List<PropertyDescriptor> getSupportedPropertyDescriptors()
AbstractConfigurableComponent
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
@OnScheduled public void onScheduled(ProcessContext context)
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
protected java.util.HashMap<java.lang.String,java.lang.Object> runInsert(com.rethinkdb.gen.ast.Insert insert)
@OnStopped public void close()
protected com.rethinkdb.RethinkDB getRethinkDB()
protected com.rethinkdb.gen.ast.Table getRdbTable()
protected com.rethinkdb.net.Connection makeConnection()