public class JDBCEmitter extends org.apache.tika.pipes.emitter.AbstractEmitter implements org.apache.tika.config.Initializable, Closeable
It is currently NOT thread safe because of the shared prepared statement, and depending on the jdbc implementation because of the shared connection.
As of the 2.5.0 release, this is ALPHA version. There may be breaking changes in the future.
| Modifier and Type | Class and Description |
|---|---|
static class |
JDBCEmitter.AttachmentStrategy |
| Constructor and Description |
|---|
JDBCEmitter() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkInitialization(org.apache.tika.config.InitializableProblemHandler problemHandler) |
void |
close() |
void |
emit(List<? extends org.apache.tika.pipes.emitter.EmitData> emitData) |
void |
emit(String emitKey,
List<org.apache.tika.metadata.Metadata> metadataList)
This executes the emit with each call.
|
void |
initialize(Map<String,org.apache.tika.config.Param> params) |
void |
setAlterTable(String alterTable)
This is called immediately after the table is created.
|
void |
setAttachmentStrategy(JDBCEmitter.AttachmentStrategy attachmentStrategy) |
void |
setAttachmentStrategy(String attachmentStrategy) |
void |
setConnection(String connectionString) |
void |
setCreateTable(String createTable) |
void |
setInsert(String insert) |
void |
setKeys(Map<String,String> keys)
The implementation of keys should be a LinkedHashMap because
order matters!
|
public void setAlterTable(String alterTable)
alterTable - @Field public void setCreateTable(String createTable)
@Field public void setInsert(String insert)
@Field public void setConnection(String connectionString)
@Field public void setKeys(Map<String,String> keys)
Key is the name of the metadata field, value is the type of column: boolean, string, int, long
keys - public void setAttachmentStrategy(JDBCEmitter.AttachmentStrategy attachmentStrategy)
@Field public void setAttachmentStrategy(String attachmentStrategy)
public void emit(String emitKey, List<org.apache.tika.metadata.Metadata> metadataList) throws IOException, org.apache.tika.pipes.emitter.TikaEmitterException
emit(List).emit in interface org.apache.tika.pipes.emitter.EmitteremitKey - emit keymetadataList - list of metadata per fileIOExceptionorg.apache.tika.pipes.emitter.TikaEmitterExceptionpublic void emit(List<? extends org.apache.tika.pipes.emitter.EmitData> emitData) throws IOException, org.apache.tika.pipes.emitter.TikaEmitterException
emit in interface org.apache.tika.pipes.emitter.Emitteremit in class org.apache.tika.pipes.emitter.AbstractEmitterIOExceptionorg.apache.tika.pipes.emitter.TikaEmitterExceptionpublic void initialize(Map<String,org.apache.tika.config.Param> params) throws org.apache.tika.exception.TikaConfigException
initialize in interface org.apache.tika.config.Initializableorg.apache.tika.exception.TikaConfigExceptionpublic void checkInitialization(org.apache.tika.config.InitializableProblemHandler problemHandler)
throws org.apache.tika.exception.TikaConfigException
checkInitialization in interface org.apache.tika.config.Initializableorg.apache.tika.exception.TikaConfigExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2007–2022 The Apache Software Foundation. All rights reserved.