public abstract class OutputStoreObjectSupport extends StoreObjectSupport
OutputStoreObjectSupport is meant to be used from a store
DataWriter implementations by keeping current writing state.| Constructor and Description |
|---|
OutputStoreObjectSupport(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new abstract output store support.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.hadoop.fs.FileStatus[] |
findInitFiles(org.apache.hadoop.fs.Path basePath) |
OutputContext |
getOutputContext()
Gets the strategy context.
|
protected org.apache.hadoop.fs.Path |
getResolvedPath()
Gets the resolved path.
|
protected void |
initOutputContext() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected void |
renameFile(org.apache.hadoop.fs.Path path)
Rename file using prefix and suffix settings.
|
void |
setFileNamingStrategy(FileNamingStrategy fileNamingStrategy)
Sets the file naming strategy.
|
void |
setInWritingPrefix(java.lang.String prefix)
Sets the in writing prefix.
|
void |
setInWritingSuffix(java.lang.String suffix)
Sets the in writing suffix.
|
void |
setOverwrite(boolean overwrite)
Sets the flag indicating if written files may be overwritten.
|
void |
setRolloverStrategy(RolloverStrategy rolloverStrategy)
Sets the rollover strategy.
|
protected void |
setWritePosition(long position)
Sets the write position.
|
doStart, doStop, getCodec, getConfiguration, getPath, handleIdleTimeout, isCompressed, resetIdleTimeout, setIdleTimeoutafterPropertiesSet, getBeanFactory, getPhase, getStoreEventPublisher, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setStoreEventPublisher, setTaskExecutor, setTaskScheduler, start, stop, stoppublic OutputStoreObjectSupport(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
configuration - the hadoop configurationbasePath - the hdfs pathcodec - the compression codec infoprotected void onInit()
throws java.lang.Exception
LifecycleObjectSupportInitializingBean phase.
Implementor should always call super method not to break initialization chain.onInit in class StoreObjectSupportjava.lang.Exceptionprotected void initOutputContext()
throws java.lang.Exception
java.lang.Exceptionprotected org.apache.hadoop.fs.FileStatus[] findInitFiles(org.apache.hadoop.fs.Path basePath)
throws java.lang.Exception
java.lang.Exceptionpublic OutputContext getOutputContext()
public void setFileNamingStrategy(FileNamingStrategy fileNamingStrategy)
StrategyContext.fileNamingStrategy - the new file naming strategypublic void setRolloverStrategy(RolloverStrategy rolloverStrategy)
StrategyContext.rolloverStrategy - the new rollover strategypublic void setInWritingSuffix(java.lang.String suffix)
suffix - the new in writing suffixpublic void setInWritingPrefix(java.lang.String prefix)
prefix - the new in writing prefixpublic void setOverwrite(boolean overwrite)
FALSE meaning StoreException
is thrown if file is about to get overwritten.overwrite - the new overwriteprotected org.apache.hadoop.fs.Path getResolvedPath()
protected void setWritePosition(long position)
position - the new write positionprotected void renameFile(org.apache.hadoop.fs.Path path)
path - the path to rename