Search in sources :

Example 11 with BBoxDBInstanceManager

use of org.bboxdb.distribution.membership.BBoxDBInstanceManager in project bboxdb by jnidzwetzki.

the class CLI method actionShowInstances.

/**
 * Show all discovered instances
 * @param line
 */
protected void actionShowInstances(final CommandLine line) {
    System.out.println("Show all discovered BBoxDB instances");
    final BBoxDBInstanceManager distributedInstanceManager = BBoxDBInstanceManager.getInstance();
    final List<BBoxDBInstance> allInstances = distributedInstanceManager.getInstances();
    allInstances.sort((i1, i2) -> i1.getIp().compareTo(i2.getIp()));
    System.out.println();
    System.out.println("#######");
    allInstances.forEach(i -> System.out.println(i));
    System.out.println("#######");
}
Also used : BBoxDBInstanceManager(org.bboxdb.distribution.membership.BBoxDBInstanceManager) BBoxDBInstance(org.bboxdb.distribution.membership.BBoxDBInstance)

Aggregations

BBoxDBInstance (org.bboxdb.distribution.membership.BBoxDBInstance)11 BBoxDBInstanceManager (org.bboxdb.distribution.membership.BBoxDBInstanceManager)11 ZookeeperClient (org.bboxdb.distribution.zookeeper.ZookeeperClient)9 Test (org.junit.Test)9 ZookeeperBBoxDBInstanceAdapter (org.bboxdb.distribution.membership.ZookeeperBBoxDBInstanceAdapter)4 CountDownLatch (java.util.concurrent.CountDownLatch)3 DistributedInstanceEvent (org.bboxdb.distribution.membership.DistributedInstanceEvent)3 HashSet (java.util.HashSet)1 ResourceAllocationException (org.bboxdb.distribution.placement.ResourceAllocationException)1 ResourcePlacementStrategy (org.bboxdb.distribution.placement.ResourcePlacementStrategy)1 DistributionGroupConfiguration (org.bboxdb.storage.entity.DistributionGroupConfiguration)1