Package org.elasticsearch.discovery

Examples of org.elasticsearch.discovery.Discovery$AckListener


                    continue;
                }

                IMetric metric = (IMetric)obj;
                Locator locator = metric.getLocator();
                Discovery md = new Discovery(locator.getTenantId(), locator.getMetricName());

                Map<String, Object> info = new HashMap<String, Object>();


                if (obj instanceof  Metric && getUnit((Metric)metric) != null) { // metric units may be null
                    info.put(unit.toString(), getUnit((Metric)metric));
                }

                md.withAnnotation(info);
                bulk.add(createSingleRequest(md));
            }
            bulk.execute().actionGet();
        } finally {
            ctx.stop();
View Full Code Here


            OsService osService = mock(OsService.class);
            OsStats osStats = mock(OsStats.class);
            when(osService.stats()).thenReturn(osStats);
            when(osStats.loadAverage()).thenReturn(new double[]{1, 5, 15});
            bind(OsService.class).toInstance(osService);
            Discovery discovery = mock(Discovery.class);
            bind(Discovery.class).toInstance(discovery);
            DiscoveryNode node = mock(DiscoveryNode.class);
            when(discovery.localNode()).thenReturn(node);
            when(node.getId()).thenReturn("node-id-1");
            when(node.getName()).thenReturn("node 1");
        }
View Full Code Here

            ProcessInfo processInfo = mock(ProcessInfo.class);
            when(nodeInfo.getProcess()).thenReturn(processInfo);
            when(processInfo.getMaxFileDescriptors()).thenReturn(1000L);

            Discovery discovery = mock(Discovery.class);
            bind(Discovery.class).toInstance(discovery);
            when(discovery.localNode()).thenReturn(node);
            when(node.getId()).thenReturn("node-id-1");
            when(node.getName()).thenReturn("node 1");
            TransportAddress transportAddress = new InetSocketTransportAddress("localhost", 44300);
            when(node.address()).thenReturn(transportAddress);
View Full Code Here

TOP

Related Classes of org.elasticsearch.discovery.Discovery$AckListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.