org.apache.hadoop.hbase.zookeeper
Class ZKSplitLog

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZKSplitLog

public class ZKSplitLog
extends Object

Common methods and attributes used by SplitLogManager and SplitLogWorker


Nested Class Summary
static class ZKSplitLog.Counters
           
static class ZKSplitLog.TaskState
           
 
Field Summary
static int DEFAULT_MAX_RESUBMIT
           
static int DEFAULT_TIMEOUT
           
static int DEFAULT_UNASSIGNED_TIMEOUT
           
static int DEFAULT_ZK_RETRIES
           
 
Constructor Summary
ZKSplitLog()
           
 
Method Summary
static String decode(String s)
           
static String encode(String s)
           
static String getEncodedNodeName(ZooKeeperWatcher zkw, String filename)
          Gets the full path node name for the log file being split.
static String getFileName(String node)
           
static String getRescanNode(ZooKeeperWatcher zkw)
           
static org.apache.hadoop.fs.Path getSplitLogDir(org.apache.hadoop.fs.Path rootdir, String tmpname)
           
static String getSplitLogDirTmpComponent(String worker, String file)
           
static boolean isCorrupted(org.apache.hadoop.fs.Path rootdir, String tmpname, org.apache.hadoop.fs.FileSystem fs)
           
static boolean isCorruptFlagFile(org.apache.hadoop.fs.Path file)
           
static boolean isRescanNode(ZooKeeperWatcher zkw, String path)
           
static boolean isTaskPath(ZooKeeperWatcher zkw, String path)
           
static void markCorrupted(org.apache.hadoop.fs.Path rootdir, String tmpname, org.apache.hadoop.fs.FileSystem fs)
           
static org.apache.hadoop.fs.Path stripSplitLogTempDir(org.apache.hadoop.fs.Path rootdir, org.apache.hadoop.fs.Path file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
See Also:
Constant Field Values

DEFAULT_ZK_RETRIES

public static final int DEFAULT_ZK_RETRIES
See Also:
Constant Field Values

DEFAULT_MAX_RESUBMIT

public static final int DEFAULT_MAX_RESUBMIT
See Also:
Constant Field Values

DEFAULT_UNASSIGNED_TIMEOUT

public static final int DEFAULT_UNASSIGNED_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

ZKSplitLog

public ZKSplitLog()
Method Detail

getEncodedNodeName

public static String getEncodedNodeName(ZooKeeperWatcher zkw,
                                        String filename)
Gets the full path node name for the log file being split. This method will url encode the filename.

Parameters:
zkw - zk reference
filename - log file name (only the basename)

getFileName

public static String getFileName(String node)

encode

public static String encode(String s)

decode

public static String decode(String s)

getRescanNode

public static String getRescanNode(ZooKeeperWatcher zkw)

isRescanNode

public static boolean isRescanNode(ZooKeeperWatcher zkw,
                                   String path)

isTaskPath

public static boolean isTaskPath(ZooKeeperWatcher zkw,
                                 String path)

getSplitLogDir

public static org.apache.hadoop.fs.Path getSplitLogDir(org.apache.hadoop.fs.Path rootdir,
                                                       String tmpname)

stripSplitLogTempDir

public static org.apache.hadoop.fs.Path stripSplitLogTempDir(org.apache.hadoop.fs.Path rootdir,
                                                             org.apache.hadoop.fs.Path file)

getSplitLogDirTmpComponent

public static String getSplitLogDirTmpComponent(String worker,
                                                String file)

markCorrupted

public static void markCorrupted(org.apache.hadoop.fs.Path rootdir,
                                 String tmpname,
                                 org.apache.hadoop.fs.FileSystem fs)

isCorrupted

public static boolean isCorrupted(org.apache.hadoop.fs.Path rootdir,
                                  String tmpname,
                                  org.apache.hadoop.fs.FileSystem fs)
                           throws IOException
Throws:
IOException

isCorruptFlagFile

public static boolean isCorruptFlagFile(org.apache.hadoop.fs.Path file)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.