use of org.apache.ignite.lang.IgniteInternalException in project ignite-3 by apache.
the class RocksDbPartitionStorage method restoreSnapshot.
/**
* {@inheritDoc}
*/
@Override
public void restoreSnapshot(Path path) {
try (IngestExternalFileOptions ingestOptions = new IngestExternalFileOptions()) {
Path snapshotPath = path.resolve(data.name());
if (!Files.exists(snapshotPath)) {
throw new IgniteInternalException("Snapshot not found: " + snapshotPath);
}
data.ingestExternalFile(Collections.singletonList(snapshotPath.toString()), ingestOptions);
} catch (RocksDBException e) {
throw new IgniteInternalException("Fail to ingest sst file at path: " + path, e);
}
}
use of org.apache.ignite.lang.IgniteInternalException in project ignite-3 by apache.
the class SqlSchemaManagerImpl method awaitLatestTableSchema.
@Nullable
private IgniteTable awaitLatestTableSchema(UUID tableId) {
try {
TableImpl table = tableManager.table(tableId);
if (table == null) {
return null;
}
table.schemaView().waitLatestSchema();
return convert(table);
} catch (NodeStoppingException e) {
throw new IgniteInternalException(e);
}
}
use of org.apache.ignite.lang.IgniteInternalException in project ignite-3 by apache.
the class SqlSchemaManagerImpl method rebuild.
private void rebuild(long causalityToken) {
SchemaPlus newCalciteSchema = Frameworks.createRootSchema(false);
newCalciteSchema.add("PUBLIC", new IgniteSchema("PUBLIC"));
// TODO rewrite with VersionedValue#update to get the current (maybe temporary) value for current token
// TODO https://issues.apache.org/jira/browse/IGNITE-16543
Map<String, IgniteSchema> schemas = schemasVv.latest();
schemas.forEach(newCalciteSchema::add);
calciteSchemaVv.update(causalityToken, s -> newCalciteSchema, e -> {
throw new IgniteInternalException(e);
});
onSchemaUpdatedCallback.run();
}
Aggregations