org.kitesdk.morphline.solr
Class GenerateSolrSequenceKeyBuilder

java.lang.Object
  extended by org.kitesdk.morphline.solr.GenerateSolrSequenceKeyBuilder
All Implemented Interfaces:
CommandBuilder

public final class GenerateSolrSequenceKeyBuilder
extends Object
implements CommandBuilder

A command that assigns a record unique key that is the concatenation of the given baseIdField record field, followed by a running count of the record number within the current session. The count is reset to zero whenever a "startSession" notification is received.

For example, assume a CSV file containing multiple records but no unique ids, and the baseIdField field is the filesystem path of the file. Now this command can be used to assign the following record values to Solr's unique key field: $path#0, $path#1, ... $path#N.

The name of the unique key field is fetched from Solr's schema.xml file, as directed by the solrLocator configuration parameter.


Constructor Summary
GenerateSolrSequenceKeyBuilder()
           
 
Method Summary
 Command build(com.typesafe.config.Config config, Command parent, Command child, MorphlineContext context)
          Creates and returns a command rooted at the given morphline JSON config.
 Collection<String> getNames()
          Returns the names with which this command can be invoked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateSolrSequenceKeyBuilder

public GenerateSolrSequenceKeyBuilder()
Method Detail

getNames

public Collection<String> getNames()
Description copied from interface: CommandBuilder
Returns the names with which this command can be invoked. The returned set can contain synonyms to enable backwards compatible name changes.

Specified by:
getNames in interface CommandBuilder

build

public Command build(com.typesafe.config.Config config,
                     Command parent,
                     Command child,
                     MorphlineContext context)
Description copied from interface: CommandBuilder
Creates and returns a command rooted at the given morphline JSON config. The command will feed records into child. The command will have parent as it's parent. Additional parameters can be passed via the morphline context.

Specified by:
build in interface CommandBuilder


Copyright © 2013–2014. All rights reserved.