Package io.airlift.node

Examples of io.airlift.node.NodeInfo


    }

    @Test
    public void testBuilderNodeInfo()
    {
        NodeInfo nodeInfo = new NodeInfo(new NodeConfig().setEnvironment("test").setPool("pool"));

        ServiceDescriptor expected = new ServiceDescriptor(
                UUID.fromString("12345678-1234-1234-1234-123456789012"),
                nodeInfo.getNodeId(),
                "type",
                nodeInfo.getPool(),
                "location",
                ServiceState.STOPPED,
                ImmutableMap.of("a", "apple", "b", "banana"));

        ServiceDescriptor actual = serviceDescriptor(expected.getType())
View Full Code Here


    @Test
    public void testNullServiceInventory()
    {
        try (JettyHttpClient httpClient = new JettyHttpClient()) {
            ServiceInventory serviceInventory = new ServiceInventory(new ServiceInventoryConfig(),
                    new NodeInfo("test"),
                    JsonCodec.jsonCodec(ServiceDescriptorsRepresentation.class),
                    httpClient);

            Assert.assertEquals(Iterables.size(serviceInventory.getServiceDescriptors()), 0);
            serviceInventory.updateServiceInventory();
View Full Code Here

        try (JettyHttpClient httpClient = new JettyHttpClient()) {
            ServiceInventoryConfig serviceInventoryConfig = new ServiceInventoryConfig()
                    .setServiceInventoryUri(Resources.getResource("service-inventory.json").toURI());

            ServiceInventory serviceInventory = new ServiceInventory(serviceInventoryConfig,
                    new NodeInfo("test"),
                    JsonCodec.jsonCodec(ServiceDescriptorsRepresentation.class),
                    httpClient);

            Assert.assertEquals(Iterables.size(serviceInventory.getServiceDescriptors()), 2);
            Assert.assertEquals(Iterables.size(serviceInventory.getServiceDescriptors("discovery")), 2);
View Full Code Here

            // test
            ServiceInventoryConfig serviceInventoryConfig = new ServiceInventoryConfig()
                    .setServiceInventoryUri(baseURI);

            ServiceInventory serviceInventory = new ServiceInventory(serviceInventoryConfig,
                    new NodeInfo("test"),
                    JsonCodec.jsonCodec(ServiceDescriptorsRepresentation.class),
                    httpClient);

            Assert.assertEquals(Iterables.size(serviceInventory.getServiceDescriptors()), 2);
            Assert.assertEquals(Iterables.size(serviceInventory.getServiceDescriptors("discovery")), 2);
View Full Code Here

    {
        tempDir = Files.createTempDir().getCanonicalFile(); // getCanonicalFile needed to get around Issue 365 (http://code.google.com/p/guava-libraries/issues/detail?id=365)
        config = new HttpServerConfig()
                .setHttpPort(0)
                .setLogPath(new File(tempDir, "http-request.log").getAbsolutePath());
        nodeInfo = new NodeInfo("test");
        httpServerInfo = new HttpServerInfo(config, nodeInfo);
    }
View Full Code Here

        if (!subplan.getChildren().isEmpty()) {
            throw new AssertionError("Expected subplan to have no children");
        }

        LocalExecutionPlanner executionPlanner = new LocalExecutionPlanner(
                new NodeInfo(new NodeConfig()
                        .setEnvironment("test")
                        .setNodeId("test-node")),
                metadata,
                dataStreamProvider,
                indexManager,
View Full Code Here

        SplitSource splitSource = dualSplitManager.getPartitionSplits(tableHandle, partitionResult.getPartitions());
        split = Iterables.getOnlyElement(splitSource.getNextBatch(1));
        assertTrue(splitSource.isFinished());

        LocalExecutionPlanner planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
                metadata,
                new DataStreamManager(new DualDataStreamProvider()),
                new MockLocalStorageManager(new File("target/temp")),
                new RecordSinkManager(),
                new MockExchangeClientSupplier(),
                new ExpressionCompiler(metadata));

        taskExecutor = new TaskExecutor(8);
        taskExecutor.start();

        tableScanNodeId = new PlanNodeId("tableScan");
        PlanFragment testFragment = new PlanFragment(
                new PlanFragmentId("fragment"),
                new TableScanNode(
                        tableScanNodeId,
                        tableHandle,
                        ImmutableList.of(symbol),
                        ImmutableMap.of(symbol, columnHandle),
                        null,
                        Optional.<GeneratedPartitions>absent()),
                ImmutableMap.of(symbol, Type.VARCHAR),
                PlanDistribution.SOURCE,
                tableScanNodeId,
                OutputPartitioning.NONE,
                ImmutableList.<Symbol>of());

        TaskId taskId = new TaskId("query", "stage", "task");
        Session session = new Session("user", "test", "default", "default", "test", "test");

        taskNotificationExecutor = Executors.newCachedThreadPool(threadsNamed("task-notification-%d"));

        outputBuffers = OutputBuffers.INITIAL_EMPTY_OUTPUT_BUFFERS;

        taskExecution = SqlTaskExecution.createSqlTaskExecution(
                session,
                taskId,
                URI.create("fake://task/" + taskId),
                testFragment,
                ImmutableList.<TaskSource>of(),
                outputBuffers,
                planner,
                new DataSize(32, Unit.MEGABYTE),
                taskExecutor,
                taskNotificationExecutor,
                new DataSize(256, Unit.MEGABYTE),
                new DataSize(8, Unit.MEGABYTE),
                new QueryMonitor(new ObjectMapperProvider().get(), new NullEventClient(), new NodeInfo("test")),
                false);
    }
View Full Code Here

        SubPlan subplan = new DistributedLogicalPlanner(metadata, idAllocator).createSubPlans(plan, true);
        assertTrue(subplan.getChildren().isEmpty(), "Expected subplan to have no children");

        LocalExecutionPlanner executionPlanner = new LocalExecutionPlanner(
                new NodeInfo(new NodeConfig()
                        .setEnvironment("test")
                        .setNodeId("test-node")),
                metadata,
                dataStreamProvider,
                storageManager,
View Full Code Here

        SplitSource splitSource = dualSplitManager.getPartitionSplits(tableHandle, partitionResult.getPartitions());
        split = Iterables.getOnlyElement(splitSource.getNextBatch(1));
        assertTrue(splitSource.isFinished());

        planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
                metadata,
                new DataStreamManager(new DualDataStreamProvider()),
                new MockLocalStorageManager(new File("target/temp")),
                new RecordSinkManager(),
                new MockExchangeClientSupplier(),
                new ExpressionCompiler(metadata));

        taskExecutor = new TaskExecutor(8);
        taskExecutor.start();

        sqlTaskManager = new SqlTaskManager(
                planner,
                new MockLocationFactory(),
                taskExecutor,
                new QueryMonitor(new ObjectMapperProvider().get(), new NullEventClient(), new NodeInfo("test")),
                new TaskManagerConfig());

        tableScanNodeId = new PlanNodeId("tableScan");
        testFragment = new PlanFragment(
                new PlanFragmentId("fragment"),
View Full Code Here

    {
        sqlTaskManager = new SqlTaskManager(
                planner,
                new MockLocationFactory(),
                taskExecutor,
                new QueryMonitor(new ObjectMapperProvider().get(), new NullEventClient(), new NodeInfo("test")),
                new TaskManagerConfig().setInfoMaxAge(new Duration(5, TimeUnit.MILLISECONDS)));

        TaskInfo taskInfo = sqlTaskManager.updateTask(session,
                taskId,
                testFragment,
View Full Code Here

TOP

Related Classes of io.airlift.node.NodeInfo

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.