org.apache.accumulo.examples.simple.dirlist
public class QueryUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QueryUtil.Opts |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
QueryUtil(QueryUtil.Opts opts) |
Modifier and Type | Method and Description |
---|---|
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.
|
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
public QueryUtil(QueryUtil.Opts opts) throws AccumuloException, AccumuloSecurityException
public static int getDepth(String path)
path
- the full path of a file or directorypublic static org.apache.hadoop.io.Text getRow(String path)
path
- the full path of a file or directorypublic static org.apache.hadoop.io.Text getForwardIndex(String path)
FORWARD_PREFIX
for the index table.path
- the full path of a file or directorypublic 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 directorypublic 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 directoryTableNotFoundException
public Map<String,Map<String,String>> getDirList(String path) throws TableNotFoundException
path
- the full path of a directoryTableNotFoundException
public Iterable<Map.Entry<Key,Value>> exactTermSearch(String term) throws Exception
term
- the name a file or directory to search forException
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 endException
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
Copyright © 2015 Apache Accumulo Project. All Rights Reserved.