Class Utils
- java.lang.Object
-
- org.apache.accumulo.master.tableOps.Utils
-
public class Utils extends Object
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckNamespaceDoesNotExist(ServerContext context, String namespace, NamespaceId namespaceId, TableOperation operation)static voidcheckTableDoesNotExist(ServerContext context, String tableName, TableId tableId, TableOperation operation)static LockgetIdLock()static <T extends AbstractId<T>>
TgetNextId(String name, ServerContext context, Function<String,T> newIdFunction)static LockgetReadLock(Master env, AbstractId<?> id, long tid)static SortedSet<org.apache.hadoop.io.Text>getSortedSetFromFile(org.apache.hadoop.fs.FSDataInputStream inputStream, boolean encoded)Given an input stream and a flag indicating if the file info is base64 encoded or not, retrieve the data from a file on the file system.static LockgetTableNameLock()static longreserveHdfsDirectory(Master env, String directory, long tid)static longreserveNamespace(Master env, NamespaceId namespaceId, long id, boolean writeLock, boolean mustExist, TableOperation op)static longreserveTable(Master env, TableId tableId, long tid, boolean writeLock, boolean tableMustExist, TableOperation op)static voidunreserveHdfsDirectory(Master env, String directory, long tid)static voidunreserveNamespace(Master env, NamespaceId namespaceId, long id, boolean writeLock)static voidunreserveTable(Master env, TableId tableId, long tid, boolean writeLock)
-
-
-
Method Detail
-
checkTableDoesNotExist
public static void checkTableDoesNotExist(ServerContext context, String tableName, TableId tableId, TableOperation operation) throws AcceptableThriftTableOperationException
-
getNextId
public static <T extends AbstractId<T>> T getNextId(String name, ServerContext context, Function<String,T> newIdFunction) throws AcceptableThriftTableOperationException
-
reserveTable
public static long reserveTable(Master env, TableId tableId, long tid, boolean writeLock, boolean tableMustExist, TableOperation op) throws Exception
- Throws:
Exception
-
unreserveTable
public static void unreserveTable(Master env, TableId tableId, long tid, boolean writeLock)
-
unreserveNamespace
public static void unreserveNamespace(Master env, NamespaceId namespaceId, long id, boolean writeLock)
-
reserveNamespace
public static long reserveNamespace(Master env, NamespaceId namespaceId, long id, boolean writeLock, boolean mustExist, TableOperation op) throws Exception
- Throws:
Exception
-
reserveHdfsDirectory
public static long reserveHdfsDirectory(Master env, String directory, long tid) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
unreserveHdfsDirectory
public static void unreserveHdfsDirectory(Master env, String directory, long tid) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
getIdLock
public static Lock getIdLock()
-
getTableNameLock
public static Lock getTableNameLock()
-
getReadLock
public static Lock getReadLock(Master env, AbstractId<?> id, long tid)
-
checkNamespaceDoesNotExist
public static void checkNamespaceDoesNotExist(ServerContext context, String namespace, NamespaceId namespaceId, TableOperation operation) throws AcceptableThriftTableOperationException
-
getSortedSetFromFile
public static SortedSet<org.apache.hadoop.io.Text> getSortedSetFromFile(org.apache.hadoop.fs.FSDataInputStream inputStream, boolean encoded) throws IOException
Given an input stream and a flag indicating if the file info is base64 encoded or not, retrieve the data from a file on the file system. It is assumed that the file is textual and not binary data.- Throws:
IOException
-
-