|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.accumulo.examples.simple.dirlist.QueryUtil
public class QueryUtil
Provides utility methods for getting the info for a file, listing the contents of a directory, and performing single wild card searches on file or directory names. See docs/examples/README.dirlist for instructions.
Field Summary | |
---|---|
static org.apache.hadoop.io.Text |
COUNTS_COLQ
|
static org.apache.hadoop.io.Text |
DIR_COLF
|
static org.apache.hadoop.io.Text |
FORWARD_PREFIX
|
static org.apache.hadoop.io.Text |
INDEX_COLF
|
static org.apache.hadoop.io.Text |
REVERSE_PREFIX
|
Constructor Summary | |
---|---|
QueryUtil(String instanceName,
String zooKeepers,
String user,
String password,
String tableName,
Authorizations auths)
|
Method Summary | |
---|---|
Iterable<Map.Entry<Key,Value>> |
exactTermSearch(String term)
Scans over the index table for files or directories with a given name. |
Map<String,String> |
getData(String path)
Scans over the directory table and pulls out stat information about a path. |
static int |
getDepth(String path)
Calculates the depth of a path, i.e. |
Map<String,Map<String,String>> |
getDirList(String path)
Uses the directory table to list the contents of a directory. |
static org.apache.hadoop.io.Text |
getForwardIndex(String path)
Given a path, construct an accumulo row prepended with the FORWARD_PREFIX for the index table. |
static org.apache.hadoop.io.Text |
getReverseIndex(String path)
Given a path, construct an accumulo row prepended with the REVERSE_PREFIX with the path reversed for the index table. |
static org.apache.hadoop.io.Text |
getRow(String path)
Given a path, construct an accumulo row prepended with the path's depth for the directory table. |
static String |
getType(org.apache.hadoop.io.Text colf)
Returns either the DIR_COLF or a decoded string version of the colf. |
static void |
main(String[] args)
Lists the contents of a directory using the directory table, or searches for file or directory names (if the -search flag is included). |
Iterable<Map.Entry<Key,Value>> |
singleRestrictedWildCardSearch(String exp)
Scans over the index table for files or directories with a given name, prefix, or suffix (indicated by a wildcard '*' at the beginning or end of the term. |
Iterable<Map.Entry<Key,Value>> |
singleWildCardSearch(String exp)
Scans over the index table for files or directories with a given name that can contain a single wildcard '*' anywhere in the term. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.hadoop.io.Text DIR_COLF
public static final org.apache.hadoop.io.Text FORWARD_PREFIX
public static final org.apache.hadoop.io.Text REVERSE_PREFIX
public static final org.apache.hadoop.io.Text INDEX_COLF
public static final org.apache.hadoop.io.Text COUNTS_COLQ
Constructor Detail |
---|
public QueryUtil(String instanceName, String zooKeepers, String user, String password, String tableName, Authorizations auths) throws AccumuloException, AccumuloSecurityException
AccumuloException
AccumuloSecurityException
Method Detail |
---|
public static int getDepth(String path)
path
- the full path of a file or directory
public static org.apache.hadoop.io.Text getRow(String path)
path
- the full path of a file or directory
public static org.apache.hadoop.io.Text getForwardIndex(String path)
FORWARD_PREFIX
for the index table.
path
- the full path of a file or directory
public static org.apache.hadoop.io.Text getReverseIndex(String path)
REVERSE_PREFIX
with the path reversed for the index table.
path
- the full path of a file or directory
public static String getType(org.apache.hadoop.io.Text colf)
DIR_COLF
or a decoded string version of the colf.
colf
- the column familypublic Map<String,String> getData(String path) throws TableNotFoundException
path
- the full path of a file or directory
TableNotFoundException
public Map<String,Map<String,String>> getDirList(String path) throws TableNotFoundException
path
- the full path of a directory
TableNotFoundException
public Iterable<Map.Entry<Key,Value>> exactTermSearch(String term) throws Exception
term
- the name a file or directory to search for
Exception
public Iterable<Map.Entry<Key,Value>> singleRestrictedWildCardSearch(String exp) throws Exception
exp
- the name a file or directory to search for with an optional wildcard '*' at the beginning or end
Exception
public Iterable<Map.Entry<Key,Value>> singleWildCardSearch(String exp) throws Exception
exp
- the name a file or directory to search for with one optional wildcard '*'
Exception
public static void main(String[] args) throws Exception
args
-
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |