log.info("Taking snapshot of keyspace [" + keyspace + "]");
log.info("Snapshot name set to [" + snapshotName + "]");
long start = System.currentTimeMillis();
EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
if (columnFamilies == null || columnFamilies.length == 0) {
EmsOperation operation = emsBean.getOperation("takeSnapshot", String.class, String[].class);
operation.invoke(snapshotName, new String[]{keyspace});
} else {
EmsOperation operation = emsBean.getOperation("takeColumnFamilySnapshot", String.class, String.class,
String.class);
for (String columnFamily : columnFamilies) {
if (log.isDebugEnabled()) {
log.debug("Taking snapshot of column family [" + columnFamily + "]");
}
operation.invoke(keyspace, columnFamily, snapshotName);
}
}
long end = System.currentTimeMillis();
log.info("Finished taking snapshot of keyspace [" + keyspace + "] in " + (end - start) + " ms");