use of org.apache.accumulo.core.client.TableNotFoundException in project incubator-rya by apache.
the class EntityLocalityGroupSetter method setLocalityGroups.
public void setLocalityGroups() {
HashMap<String, Set<Text>> localityGroups = new HashMap<String, Set<Text>>();
Iterator<String> groups = getPredicates();
int i = 1;
while (groups.hasNext()) {
HashSet<Text> tempColumn = new HashSet<Text>();
String temp = groups.next();
tempColumn.add(new Text(temp));
String groupName = "predicate" + i;
localityGroups.put(groupName, tempColumn);
i++;
}
try {
conn.tableOperations().setLocalityGroups(tablePrefix + "doc_partitioned_index", localityGroups);
// conn.tableOperations().compact(tablePrefix + "doc_partitioned_index", null, null, true, true);
} catch (AccumuloException e) {
e.printStackTrace();
} catch (AccumuloSecurityException e) {
e.printStackTrace();
} catch (TableNotFoundException e) {
e.printStackTrace();
}
}
use of org.apache.accumulo.core.client.TableNotFoundException in project incubator-rya by apache.
the class EntityOptimizerTest method init.
@Before
public void init() throws RepositoryException, TupleQueryResultHandlerException, QueryEvaluationException, MalformedQueryException, AccumuloException, AccumuloSecurityException, TableExistsException {
accCon = new MockInstance("instance").getConnector("root", "".getBytes());
config = new BatchWriterConfig();
config.setMaxMemory(1000);
config.setMaxLatency(1000, TimeUnit.SECONDS);
config.setMaxWriteThreads(10);
if (accCon.tableOperations().exists("rya_prospects")) {
try {
accCon.tableOperations().delete("rya_prospects");
} catch (TableNotFoundException e) {
e.printStackTrace();
}
}
if (accCon.tableOperations().exists("rya_selectivity")) {
try {
accCon.tableOperations().delete("rya_selectivity");
} catch (TableNotFoundException e) {
e.printStackTrace();
}
}
accCon.tableOperations().create("rya_prospects");
accCon.tableOperations().create("rya_selectivity");
Configuration con = new Configuration();
con.set(ConfigUtils.CLOUDBASE_AUTHS, "U");
con.set(ConfigUtils.CLOUDBASE_INSTANCE, "instance");
con.set(ConfigUtils.CLOUDBASE_USER, "root");
con.set(ConfigUtils.CLOUDBASE_PASSWORD, "");
conf = new AccumuloRdfConfiguration(con);
TablePrefixLayoutStrategy tps = new TablePrefixLayoutStrategy("rya_");
conf.setTableLayoutStrategy(tps);
conf.set(ConfigUtils.USE_MOCK_INSTANCE, "true");
res = new ProspectorServiceEvalStatsDAO(accCon, conf);
}
use of org.apache.accumulo.core.client.TableNotFoundException in project incubator-rya by apache.
the class AccumuloUninstall method uninstall.
@Override
public void uninstall(final String ryaInstanceName) throws InstanceDoesNotExistException, RyaClientException {
requireNonNull(ryaInstanceName);
// Ensure the Rya Instance exists.
if (!instanceExists.exists(ryaInstanceName)) {
throw new InstanceDoesNotExistException(String.format("There is no Rya instance named '%s'.", ryaInstanceName));
}
try {
// Build the list of tables that are present within the Rya instance.
final List<String> tables = new RyaTableNames().getTableNames(ryaInstanceName, getConnector());
// Delete them.
final TableOperations tableOps = getConnector().tableOperations();
for (final String table : tables) {
try {
tableOps.delete(table);
} catch (final TableNotFoundException e) {
log.warn("Uninstall could not delete table named '" + LogUtils.clean(table) + "' because it does not exist. " + "Something else is also deleting tables.");
}
}
} catch (PCJStorageException | RyaDetailsRepositoryException e) {
throw new RyaClientException("Could not uninstall the Rya instance named '" + ryaInstanceName + "' because we could not determine which tables are associated with it.", e);
} catch (AccumuloException | AccumuloSecurityException e) {
throw new RyaClientException("Could not uninstall the Rya instance named '" + ryaInstanceName + "' because of a problem interacting with Accumulo..", e);
}
}
use of org.apache.accumulo.core.client.TableNotFoundException in project incubator-rya by apache.
the class EntityCentricIndex method setConf.
// initialization occurs in setConf because index is created using reflection
@Override
public void setConf(final Configuration conf) {
if (conf instanceof AccumuloRdfConfiguration) {
this.conf = (AccumuloRdfConfiguration) conf;
} else {
this.conf = new AccumuloRdfConfiguration(conf);
}
if (!isInit) {
try {
initInternal();
isInit = true;
} catch (final AccumuloException e) {
logger.warn("Unable to initialize index. Throwing Runtime Exception. ", e);
throw new RuntimeException(e);
} catch (final AccumuloSecurityException e) {
logger.warn("Unable to initialize index. Throwing Runtime Exception. ", e);
throw new RuntimeException(e);
} catch (final TableNotFoundException e) {
logger.warn("Unable to initialize index. Throwing Runtime Exception. ", e);
throw new RuntimeException(e);
} catch (final TableExistsException e) {
logger.warn("Unable to initialize index. Throwing Runtime Exception. ", e);
throw new RuntimeException(e);
} catch (final IOException e) {
logger.warn("Unable to initialize index. Throwing Runtime Exception. ", e);
throw new RuntimeException(e);
}
}
}
use of org.apache.accumulo.core.client.TableNotFoundException in project incubator-rya by apache.
the class StarQuery method getMinCardSp.
public CardinalityStatementPattern getMinCardSp(final AccumuloSelectivityEvalDAO ase) {
StatementPattern minSp = null;
double cardinality = Double.MAX_VALUE;
double tempCard = -1;
for (final StatementPattern sp : nodes) {
try {
tempCard = ase.getCardinality(ase.getConf(), sp);
if (tempCard < cardinality) {
cardinality = tempCard;
minSp = sp;
}
} catch (final TableNotFoundException e) {
e.printStackTrace();
}
}
return new CardinalityStatementPattern(minSp, cardinality);
}
Aggregations