use of com.mesosphere.sdk.storage.PersisterException in project dcos-commons by mesosphere.
the class CuratorPersister method set.
@Override
public void set(String unprefixedPath, byte[] bytes) throws PersisterException {
final String path = withFrameworkPrefix(unprefixedPath);
LOGGER.debug("Setting {} => {}", path, getInfo(bytes));
try {
try {
client.create().creatingParentsIfNeeded().forPath(path, bytes);
} catch (KeeperException.NodeExistsException e) {
client.setData().forPath(path, bytes);
}
} catch (Exception e) {
throw new PersisterException(Reason.STORAGE_ERROR, String.format("Unable to set %d bytes in %s", bytes.length, path), e);
}
}
use of com.mesosphere.sdk.storage.PersisterException in project dcos-commons by mesosphere.
the class SchemaVersionStoreTest method testCheckOtherFailure.
@Test(expected = StateStoreException.class)
public void testCheckOtherFailure() throws Exception {
when(mockPersister.get(NODE_PATH)).thenThrow(new PersisterException(Reason.LOGIC_ERROR, "hey"));
storeWithMock.check(3);
}
Aggregations