|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.BulkLoad.BulkIngester
public class BulkIngester
The primary entry point for the client-side Bulk Load Interface for loading data into an Endeca data store. It makes a socket connection to the data store and spawns a thread to handle replies. Clients to this interface must:
ErrorCallback
, FinishedCallback
, AbortCallback
, and
StatusCallback
, and do something useful when their handler
methods are called (which happens in the response thread).
constructor
.
begin
method to start the response thread. If this
is not called, an IOException will be thrown.
sendRecord
repeatedly to send Record
objects
to the data store.
endIngest
to terminate the
response thread and close the socket.
Constructor Summary | |
---|---|
protected |
BulkIngester(java.io.DataInputStream din,
java.io.DataOutputStream dout,
ErrorCallback errorCallback,
FinishedCallback finishedCallback,
AbortCallback abortCallback,
StatusCallback statusCallback)
Alternative constructor for unit testing only. |
|
BulkIngester(java.lang.String host,
int port,
boolean useSSL,
boolean doFinalMerge,
boolean doUpdateDictionary,
int timeout,
ErrorCallback errorCallback,
FinishedCallback finishedCallback,
AbortCallback abortCallback,
StatusCallback statusCallback)
Primary constructor. |
Method Summary | |
---|---|
void |
begin()
Spawn a thread to asynchronously read the data store's responses. |
void |
endIngest()
Terminates the response thread and closes the socket. |
void |
requestStatusUpdate()
Poll the data store on its current status. |
void |
sendCancel()
Tell the data store that the client wants to cancel the bulk ingest process. |
void |
sendRecord(Data.Record rec)
Sends the provided record over the wire to the data store. |
void |
setFinalMerge(boolean doFinalMerge)
Set whether to perform the final merge after this ingestion. |
void |
setTransactionId(java.lang.String transactionId)
Set the transaction ID. |
void |
setUpdateDictionary(boolean doUpdateDictionary)
Set whether to rebuild the aspell dictionary after this ingestion, so that the newly-added data will be available for spelling hints and autocorrect. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BulkIngester(java.lang.String host, int port, boolean useSSL, boolean doFinalMerge, boolean doUpdateDictionary, int timeout, ErrorCallback errorCallback, FinishedCallback finishedCallback, AbortCallback abortCallback, StatusCallback statusCallback) throws java.io.IOException
host
- Hostname of the data store.port
- Port number to connect to on same.useSSL
- Whether to connect via SSL.doFinalMerge
- Whether to perform the final merge after ingestion.doUpdateDictionary
- Whether to update the aspell dictionary after ingestion.timeout
- Timeout for connecting to the data store.errorCallback
- ErrorCallback object to handle error conditions.finishedCallback
- FinishedCallback object to be called when ingestion finishes.abortCallback
- AbortCallback object to handle aborts.statusCallback
- StatusCallback object to handle status updates.
java.io.IOException
protected BulkIngester(java.io.DataInputStream din, java.io.DataOutputStream dout, ErrorCallback errorCallback, FinishedCallback finishedCallback, AbortCallback abortCallback, StatusCallback statusCallback)
din
- dout
- errorCallback
- ErrorCallback object to handle error conditions.finishedCallback
- FinishedCallback object to be called when ingestion finishes.abortCallback
- AbortCallback object to handle aborts.statusCallback
- StatusCallback object to handle status updates.Method Detail |
---|
public void setTransactionId(java.lang.String transactionId)
endIngest
.
transactionId
- The transaction ID.public void setFinalMerge(boolean doFinalMerge)
true
. If doing multiple consecutive
bulk load operations, set this to false
on all except
the last one.
Can be called at any time before endIngest
.
doFinalMerge
- true
if final merge is to be performed,
otherwise False.public void setUpdateDictionary(boolean doUpdateDictionary)
true
. If doing multiple consecutive
bulk load operations, set this to false
on all except
the last one.
Can be called at any time before endIngest
.
doUpdateDictionary
- true
if dictionary is to be
updated, otherwise False.public void begin() throws java.io.IOException
java.io.IOException
public void endIngest() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public void sendRecord(Data.Record rec) throws java.io.IOException
rec
- The record
to send.
java.io.IOException
public void requestStatusUpdate() throws java.io.IOException
java.io.IOException
public void sendCancel() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |