use of org.onosproject.store.service.StorageAdminService in project onos by opennetworkinglab.
the class TransactionsCommand method doExecute.
@Override
protected void doExecute() {
StorageAdminService storageAdminService = get(StorageAdminService.class);
Collection<TransactionId> transactionIds = storageAdminService.getPendingTransactions();
if (outputJson()) {
print("%s", json(transactionIds));
} else {
transactionIds.forEach(id -> print("%s", id.toString()));
}
}
use of org.onosproject.store.service.StorageAdminService in project onos by opennetworkinglab.
the class MapsListCommand method doExecute.
@Override
protected void doExecute() {
StorageAdminService storageAdminService = get(StorageAdminService.class);
List<MapInfo> mapInfo = storageAdminService.getMapInfo();
if (outputJson()) {
print("%s", json(mapInfo));
} else {
displayMaps(mapInfo);
}
}
use of org.onosproject.store.service.StorageAdminService in project onos by opennetworkinglab.
the class QueuesListCommand method doExecute.
@Override
protected void doExecute() {
StorageAdminService storageAdminService = get(StorageAdminService.class);
Map<String, WorkQueueStats> queueStats = storageAdminService.getQueueStats();
if (outputJson()) {
ObjectMapper mapper = new ObjectMapper();
ObjectNode jsonQueues = mapper.createObjectNode();
queueStats.forEach((k, v) -> {
ObjectNode jsonStats = jsonQueues.putObject(k);
jsonStats.put("pending", v.totalPending());
jsonStats.put("inProgress", v.totalInProgress());
jsonStats.put("completed", v.totalCompleted());
});
print("%s", jsonQueues);
} else {
queueStats.forEach((name, stats) -> print(FMT, name, stats.totalPending(), stats.totalInProgress(), stats.totalCompleted()));
}
}
use of org.onosproject.store.service.StorageAdminService in project onos by opennetworkinglab.
the class CountersListCommand method doExecute.
@Override
protected void doExecute() {
StorageAdminService storageAdminService = get(StorageAdminService.class);
Map<String, Long> counters = storageAdminService.getCounters();
if (outputJson()) {
ObjectMapper mapper = new ObjectMapper();
ObjectNode jsonCounters = mapper.createObjectNode();
counters.forEach((k, v) -> jsonCounters.put(k, v));
print("%s", jsonCounters);
} else {
counters.keySet().stream().sorted().forEach(name -> print(FMT, name, counters.get(name)));
}
}
Aggregations