org.apache.hadoop.chukwa.datacollection.writer.localfs
Class LocalToRemoteHdfsMover

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.hadoop.chukwa.datacollection.writer.localfs.LocalToRemoteHdfsMover
All Implemented Interfaces:
Runnable

public class LocalToRemoteHdfsMover
extends Thread

This class is used by LocalWriter.java. The only role of this class is to move dataSink files from the local file system to the remote HDFS. Those 2 classes are using a blockingQueue to exchange information. This class will also take care of moving all existing done dataSink files (.done) and any dataSink file that has not been changed for at least (rotatePeriod+2min).


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LocalToRemoteHdfsMover(BlockingQueue<String> fileQueue, org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
protected  void cleanup()
           
protected  void init()
           
protected  void moveFile(String filePath)
           
 void run()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalToRemoteHdfsMover

public LocalToRemoteHdfsMover(BlockingQueue<String> fileQueue,
                              org.apache.hadoop.conf.Configuration conf)
Method Detail

init

protected void init()
             throws Throwable
Throws:
Throwable

moveFile

protected void moveFile(String filePath)
                 throws Exception
Throws:
Exception

cleanup

protected void cleanup()
                throws Exception
Throws:
Exception

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

shutdown

public void shutdown()


Copyright © ${year} The Apache Software Foundation