本文整理汇总了Java中org.apache.accumulo.core.client.TableNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java TableNotFoundException类的具体用法?Java TableNotFoundException怎么用?Java TableNotFoundException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableNotFoundException类属于org.apache.accumulo.core.client包,在下文中一共展示了TableNotFoundException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResult
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
public String getResult() throws IOException, AccumuloSecurityException, AccumuloException, TableNotFoundException {
resultBuilder.append("[");
GeoTemporalTweetQuery query = new GeoTemporalTweetQuery(config);
query.setBoundingBox(
Double.parseDouble(northCoordinate),
Double.parseDouble(eastCoordinate),
Double.parseDouble(southCoordinate),
Double.parseDouble(westCoordinate));
query.setTimeRange(
Long.parseLong(startTime),
Long.parseLong(endTime));
query.setCallback(this);
// start the query -> process is called once for each result
query.query();
resultBuilder.append("]");
return resultBuilder.toString();
}
示例2: SignedBatchWriter
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
/**
* Create an signed batch tableWriter.
*
* @param connector
* The connector for the Accumulo instance.
* @param tableName
* Name of the table to write to.
* @param batchConfig
* Configuration for a {@link BatchWriter}.
* @param signatureConfig
* Configuration for the signatures.
* @param keys
* Container with the keys to use for signatures.
*/
public SignedBatchWriter(Connector connector, String tableName, BatchWriterConfig batchConfig, SignatureConfig signatureConfig, SignatureKeyContainer keys)
throws TableNotFoundException {
checkArgument(connector != null, "connector is null");
checkArgument(tableName != null, "tableName is null");
checkArgument(signatureConfig != null, "signatureConfig is null");
checkArgument(keys != null, "keys is null");
this.tableWriter = connector.createBatchWriter(tableName, batchConfig);
this.signer = new EntrySigner(signatureConfig, keys);
this.signatureConfig = signatureConfig;
if (signatureConfig.destination == SignatureConfig.Destination.SEPARATE_TABLE) {
this.signatureTableWriter = connector.createBatchWriter(signatureConfig.destinationTable, batchConfig);
} else {
this.signatureTableWriter = null;
}
}
示例3: SignedScanner
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
/**
* Create an signed scanner.
*
* @param connector
* The connector for the Accumulo instance.
* @param tableName
* Name of the table to write to.
* @param authorizations
* The authorizations this user has for querying Accumulo.
* @param signatureConfig
* Configuration for the verification.
* @param keys
* Container with the keys to use for signatures.
*/
public SignedScanner(Connector connector, String tableName, Authorizations authorizations, SignatureConfig signatureConfig, SignatureKeyContainer keys)
throws TableNotFoundException {
checkArgument(connector != null, "connection is null");
checkArgument(tableName != null, "tableName is null");
checkArgument(authorizations != null, "authorizations is null");
checkArgument(signatureConfig != null, "config is null");
checkArgument(keys != null, "keys is null");
this.valueScanner = connector.createScanner(tableName, authorizations);
this.verifier = new EntrySigner(signatureConfig, keys);
if (signatureConfig.destination == SignatureConfig.Destination.SEPARATE_TABLE) {
this.signatureScanner = connector.createScanner(signatureConfig.destinationTable, authorizations);
} else {
this.signatureScanner = null;
}
}
示例4: SignedBatchScanner
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
/**
* Create an encrypted batch scanner.
*
* @param connector
* The connector for the Accumulo instance.
* @param tableName
* Name of the table to write to.
* @param authorizations
* The authorizations this user has for querying Accumulo.
* @param numQueryThreads
* Maximimum number of query threads to use for this scanner.
* @param signatureConfig
* Configuration for the decryption.
* @param keys
* Container with the keys to use for decryption.
*/
public SignedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, SignatureConfig signatureConfig,
SignatureKeyContainer keys) throws TableNotFoundException {
checkArgument(connector != null, "connection is null");
checkArgument(tableName != null, "tableName is null");
checkArgument(authorizations != null, "authorizations is null");
checkArgument(signatureConfig != null, "config is null");
checkArgument(keys != null, "keys is null");
this.valueScanner = connector.createBatchScanner(tableName, authorizations, numQueryThreads);
this.verifier = new EntrySigner(signatureConfig, keys);
if (signatureConfig.destination == SignatureConfig.Destination.SEPARATE_TABLE) {
this.signatureScanner = connector.createBatchScanner(signatureConfig.destinationTable, authorizations, numQueryThreads);
} else {
this.signatureScanner = null;
}
}
示例5: createScanner
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
private Scanner createScanner(Query<K,T> query) throws TableNotFoundException {
// TODO make isolated scanner optional?
Scanner scanner = new IsolatedScanner(conn.createScanner(mapping.tableName, Constants.NO_AUTHS));
setFetchColumns(scanner, query.getFields());
scanner.setRange(createRange(query));
if (query.getStartTime() != -1 || query.getEndTime() != -1) {
IteratorSetting is = new IteratorSetting(30, TimestampFilter.class);
if (query.getStartTime() != -1)
TimestampFilter.setStart(is, query.getStartTime(), true);
if (query.getEndTime() != -1)
TimestampFilter.setEnd(is, query.getEndTime(), true);
scanner.addScanIterator(is);
}
return scanner;
}
示例6: main
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, MutationsRejectedException, TableExistsException,
TableNotFoundException {
ClientOnRequiredTable opts = new ClientOnRequiredTable();
BatchWriterOpts bwOpts = new BatchWriterOpts();
opts.parseArgs(InsertWithBatchWriter.class.getName(), args, bwOpts);
Connector connector = opts.getConnector();
MultiTableBatchWriter mtbw = connector.createMultiTableBatchWriter(bwOpts.getBatchWriterConfig());
if (!connector.tableOperations().exists(opts.getTableName()))
connector.tableOperations().create(opts.getTableName());
BatchWriter bw = mtbw.getBatchWriter(opts.getTableName());
Text colf = new Text("colfam");
System.out.println("writing ...");
for (int i = 0; i < 10000; i++) {
Mutation m = new Mutation(new Text(String.format("row_%d", i)));
for (int j = 0; j < 5; j++) {
m.put(colf, new Text(String.format("colqual_%d", j)), new Value((String.format("value_%d_%d", i, j)).getBytes()));
}
bw.addMutation(m);
if (i % 100 == 0)
System.out.println(i);
}
mtbw.close();
}
示例7: init
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
public void init() throws TableNotFoundException {
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new NodeInfo(topPath, q.getData(topPath)));
populate(root);
populateChildren(root);
treeModel = new DefaultTreeModel(root);
tree = new JTree(treeModel);
tree.addTreeExpansionListener(this);
tree.addTreeSelectionListener(this);
text = new JTextArea(getText(q.getData(topPath)));
data = new JTextArea("");
JScrollPane treePane = new JScrollPane(tree);
JScrollPane textPane = new JScrollPane(text);
dataPane = new JScrollPane(data);
JSplitPane infoSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, textPane, dataPane);
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePane, infoSplitPane);
mainSplitPane.setDividerLocation(300);
infoSplitPane.setDividerLocation(150);
getContentPane().add(mainSplitPane, BorderLayout.CENTER);
}
示例8: getDirList
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
/**
* Uses the directory table to list the contents of a directory.
*
* @param path
* the full path of a directory
*/
public Map<String,Map<String,String>> getDirList(String path) throws TableNotFoundException {
if (!path.endsWith("/"))
path = path + "/";
Map<String,Map<String,String>> fim = new TreeMap<>();
Scanner scanner = conn.createScanner(tableName, auths);
scanner.setRange(Range.prefix(getRow(path)));
for (Entry<Key,Value> e : scanner) {
String name = e.getKey().getRow().toString();
name = name.substring(name.lastIndexOf("/") + 1);
String type = getType(e.getKey().getColumnFamily());
if (!fim.containsKey(name)) {
fim.put(name, new TreeMap<String,String>());
fim.get(name).put("fullname", e.getKey().getRow().toString().substring(3));
}
fim.get(name).put(type + e.getKey().getColumnQualifier().toString() + ":" + e.getKey().getColumnVisibility().toString(), new String(e.getValue().get()));
}
return fim;
}
示例9: execute
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
public void execute(Opts opts) throws TableNotFoundException, InterruptedException, AccumuloException, AccumuloSecurityException, TableExistsException {
if (opts.createtable) {
opts.getConnector().tableOperations().create(opts.getTableName());
}
if (opts.createEntries) {
createEntries(opts);
}
if (opts.readEntries) {
readEntries(opts);
}
if (opts.deletetable) {
opts.getConnector().tableOperations().delete(opts.getTableName());
}
}
示例10: createEntries
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
private void createEntries(Opts opts) throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
// Trace the write operation. Note, unless you flush the BatchWriter, you will not capture
// the write operation as it is occurs asynchronously. You can optionally create additional Spans
// within a given Trace as seen below around the flush
TraceScope scope = Trace.startSpan("Client Write", Sampler.ALWAYS);
System.out.println("TraceID: " + Long.toHexString(scope.getSpan().getTraceId()));
BatchWriter batchWriter = opts.getConnector().createBatchWriter(opts.getTableName(), new BatchWriterConfig());
Mutation m = new Mutation("row");
m.put("cf", "cq", "value");
batchWriter.addMutation(m);
// You can add timeline annotations to Spans which will be able to be viewed in the Monitor
scope.getSpan().addTimelineAnnotation("Initiating Flush");
batchWriter.flush();
batchWriter.close();
scope.close();
}
示例11: readEntries
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
private void readEntries(Opts opts) throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
Scanner scanner = opts.getConnector().createScanner(opts.getTableName(), opts.auths);
// Trace the read operation.
TraceScope readScope = Trace.startSpan("Client Read", Sampler.ALWAYS);
System.out.println("TraceID: " + Long.toHexString(readScope.getSpan().getTraceId()));
int numberOfEntriesRead = 0;
for (Entry<Key,Value> entry : scanner) {
System.out.println(entry.getKey().toString() + " -> " + entry.getValue().toString());
++numberOfEntriesRead;
}
// You can add additional metadata (key, values) to Spans which will be able to be viewed in the Monitor
readScope.getSpan().addKVAnnotation("Number of Entries Read".getBytes(UTF_8), String.valueOf(numberOfEntriesRead).getBytes(UTF_8));
readScope.close();
}
示例12: main
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
/**
* Writes a specified number of entries to Accumulo using a {@link BatchWriter}. The rows of the entries will be sequential starting at a specified number.
* The column families will be "foo" and column qualifiers will be "1". The values will be random byte arrays of a specified size.
*/
public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException {
Opts opts = new Opts();
BatchWriterOpts bwOpts = new BatchWriterOpts();
opts.parseArgs(SequentialBatchWriter.class.getName(), args, bwOpts);
Connector connector = opts.getConnector();
BatchWriter bw = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
long end = opts.start + opts.num;
for (long i = opts.start; i < end; i++) {
Mutation m = RandomBatchWriter.createMutation(i, opts.valueSize, opts.vis);
bw.addMutation(m);
}
bw.close();
}
示例13: loadBulkFiles
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
private int loadBulkFiles() throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException
{
Configuration conf = getConf();
Connector connector = WikipediaConfiguration.getConnector(conf);
FileSystem fs = FileSystem.get(conf);
String directory = WikipediaConfiguration.bulkIngestDir(conf);
String failureDirectory = WikipediaConfiguration.bulkIngestFailureDir(conf);
for(FileStatus status: fs.listStatus(new Path(directory)))
{
if(status.isDir() == false)
continue;
Path dir = status.getPath();
Path failPath = new Path(failureDirectory+"/"+dir.getName());
fs.mkdirs(failPath);
connector.tableOperations().importDirectory(dir.getName(), dir.toString(), failPath.toString(), true);
}
return 0;
}
示例14: printAccumuloTable
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
/**
* Prints specified Accumulo table (accessible using Accumulo connector parameter)
*
* @param conn Accumulo connector of to instance with table to print
* @param accumuloTable Accumulo table to print
*/
public static void printAccumuloTable(Connector conn, String accumuloTable) {
Scanner scanner = null;
try {
scanner = conn.createScanner(accumuloTable, Authorizations.EMPTY);
} catch (TableNotFoundException e) {
throw new IllegalStateException(e);
}
Iterator<Map.Entry<Key, Value>> iterator = scanner.iterator();
System.out.println("== accumulo start ==");
while (iterator.hasNext()) {
Map.Entry<Key, Value> entry = iterator.next();
System.out.println(entry.getKey() + " " + entry.getValue());
}
System.out.println("== accumulo end ==");
}
示例15: getJoinSelect
import org.apache.accumulo.core.client.TableNotFoundException; //导入依赖的package包/类
public double getJoinSelect(RdfCloudTripleStoreConfiguration conf, TupleExpr te1, TupleExpr te2) throws TableNotFoundException {
SpExternalCollector spe = new SpExternalCollector();
te2.visit(spe);
List<QueryModelNode> espList = spe.getSpExtTup();
double min = Double.MAX_VALUE;
for (QueryModelNode node : espList) {
double select = getSelectivity(conf, te1, node);
if (min > select) {
min = select;
}
}
return min;
}