public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkNamespaceDoesNotExist(ServerContext context,
String namespace,
Namespace.ID namespaceId,
TableOperation operation) |
static void |
checkTableDoesNotExist(ServerContext context,
String tableName,
Table.ID tableId,
TableOperation operation) |
static Lock |
getIdLock() |
static <T extends AbstractId> |
getNextId(String name,
ServerContext context,
Function<String,T> newIdFunction) |
static Lock |
getReadLock(Master env,
AbstractId tableId,
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 Lock |
getTableNameLock() |
static long |
reserveHdfsDirectory(Master env,
String directory,
long tid) |
static long |
reserveNamespace(Master env,
Namespace.ID namespaceId,
long id,
boolean writeLock,
boolean mustExist,
TableOperation op) |
static long |
reserveTable(Master env,
Table.ID tableId,
long tid,
boolean writeLock,
boolean tableMustExist,
TableOperation op) |
static void |
unreserveHdfsDirectory(Master env,
String directory,
long tid) |
static void |
unreserveNamespace(Master env,
Namespace.ID namespaceId,
long id,
boolean writeLock) |
static void |
unreserveTable(Master env,
Table.ID tableId,
long tid,
boolean writeLock) |
public static void checkTableDoesNotExist(ServerContext context, String tableName, Table.ID tableId, TableOperation operation) throws AcceptableThriftTableOperationException
public static <T extends AbstractId> T getNextId(String name, ServerContext context, Function<String,T> newIdFunction) throws AcceptableThriftTableOperationException
public static long reserveTable(Master env, Table.ID tableId, long tid, boolean writeLock, boolean tableMustExist, TableOperation op) throws Exception
Exceptionpublic static void unreserveTable(Master env, Table.ID tableId, long tid, boolean writeLock)
public static void unreserveNamespace(Master env, Namespace.ID namespaceId, long id, boolean writeLock)
public static long reserveNamespace(Master env, Namespace.ID namespaceId, long id, boolean writeLock, boolean mustExist, TableOperation op) throws Exception
Exceptionpublic static long reserveHdfsDirectory(Master env, String directory, long tid) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static void unreserveHdfsDirectory(Master env, String directory, long tid) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic static Lock getIdLock()
public static Lock getTableNameLock()
public static Lock getReadLock(Master env, AbstractId tableId, long tid)
public static void checkNamespaceDoesNotExist(ServerContext context, String namespace, Namespace.ID namespaceId, TableOperation operation) throws AcceptableThriftTableOperationException
public static SortedSet<org.apache.hadoop.io.Text> getSortedSetFromFile(org.apache.hadoop.fs.FSDataInputStream inputStream, boolean encoded) throws IOException
IOExceptionCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.