use of voldemort.VoldemortException in project voldemort by voldemort.
the class HttpService method stopInner.
@Override
public void stopInner() {
try {
if (httpServer != null) {
httpServer.stop();
for (Connector c : httpServer.getConnectors()) {
c.close();
}
}
if (context != null)
context.destroy();
} catch (Exception e) {
throw new VoldemortException(e);
}
this.httpServer = null;
this.context = null;
}
use of voldemort.VoldemortException in project voldemort by voldemort.
the class ReadOnlyStoreManagementServlet method setFetcherClass.
private void setFetcherClass(VoldemortServer server) {
String className = server.getVoldemortConfig().getAllProps().getString("file.fetcher.class", null);
if (className == null || className.trim().length() == 0) {
this.fileFetcher = null;
} else {
try {
logger.info("Loading fetcher " + className);
Class<?> cls = Class.forName(className.trim());
this.fileFetcher = (FileFetcher) ReflectUtils.callConstructor(cls, new Class<?>[] { VoldemortConfig.class }, new Object[] { server.getVoldemortConfig() });
} catch (Exception e) {
throw new VoldemortException("Error loading file fetcher class " + className, e);
}
}
}
use of voldemort.VoldemortException in project voldemort by voldemort.
the class SchemaEvolutionValidator method validateAllAvroSchemas.
/**
* Given an AVRO serializer definition, validates if all the avro schemas
* are valid i.e parseable.
*
* @param avroSerDef
*/
public static void validateAllAvroSchemas(SerializerDefinition avroSerDef) {
Map<Integer, String> schemaVersions = avroSerDef.getAllSchemaInfoVersions();
if (schemaVersions.size() < 1) {
throw new VoldemortException("No schema specified");
}
for (Map.Entry<Integer, String> entry : schemaVersions.entrySet()) {
Integer schemaVersionNumber = entry.getKey();
String schemaStr = entry.getValue();
try {
Schema.parse(schemaStr);
} catch (Exception e) {
throw new VoldemortException("Unable to parse Avro schema version :" + schemaVersionNumber + ", schema string :" + schemaStr);
}
}
}
use of voldemort.VoldemortException in project voldemort by voldemort.
the class StoreRepository method addNodeStore.
public void addNodeStore(int nodeId, Store<ByteArray, byte[], byte[]> store) {
Pair<String, Integer> key = Pair.create(store.getName(), nodeId);
Store<ByteArray, byte[], byte[]> found = this.nodeStores.putIfAbsent(key, store);
if (found != null)
throw new VoldemortException("Store '" + store.getName() + "' for node " + nodeId + " has already been initialized.");
}
use of voldemort.VoldemortException in project voldemort by voldemort.
the class WriteThroughCache method put.
/**
* Updates the value in HashMap and writeBack as Atomic step
*/
@Override
public synchronized V put(K key, V value) {
V oldValue = this.get(key);
try {
super.put(key, value);
writeBack(key, value);
return oldValue;
} catch (Exception e) {
super.put(key, oldValue);
writeBack(key, oldValue);
throw new VoldemortException("Failed to put(" + key + ", " + value + ") in write through cache", e);
}
}
Aggregations