Examples of NetworkService


Examples of com.cloud.network.NetworkService

    }

    @Test
    public void testCreateProviderToPhysicalNetworkSuccess() {

        NetworkService networkService = Mockito.mock(NetworkService.class);
        addNetworkServiceProviderCmd._networkService = networkService;

        PhysicalNetworkServiceProvider physicalNetworkServiceProvider = Mockito.mock(PhysicalNetworkServiceProvider.class);
        Mockito.when(networkService.addProviderToPhysicalNetwork(Matchers.anyLong(), Matchers.anyString(), Matchers.anyLong(), Matchers.anyList())).thenReturn(
            physicalNetworkServiceProvider);

        try {
            addNetworkServiceProviderCmd.create();
        } catch (ResourceAllocationException e) {
View Full Code Here

Examples of com.cloud.network.NetworkService

    }

    @Test
    public void testCreateProviderToPhysicalNetworkFailure() throws ResourceAllocationException {

        NetworkService networkService = Mockito.mock(NetworkService.class);
        addNetworkServiceProviderCmd._networkService = networkService;

        Mockito.when(networkService.addProviderToPhysicalNetwork(Matchers.anyLong(), Matchers.anyString(), Matchers.anyLong(), Matchers.anyList())).thenReturn(null);

        try {
            addNetworkServiceProviderCmd.create();
        } catch (ServerApiException exception) {
            Assert.assertEquals("Failed to add service provider entity to physical network", exception.getDescription());
View Full Code Here

Examples of com.github.api.v2.services.NetworkService

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    NetworkService service = factory.createNetworkService();
    List<NetworkCommit> commits = service.getNetworkData("facebook", "tornado", "7b80c2f4db226d6fa3a7f3dfa59277da1d642f91");
    for (NetworkCommit commit : commits) {
      printResult(commit);
    }
  }
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

    private final Object sendMutex = new Object();

    private final Object receiveMutex = new Object();

    public MulticastZenPing(ThreadPool threadPool, TransportService transportService, ClusterName clusterName) {
        this(EMPTY_SETTINGS, threadPool, transportService, clusterName, new NetworkService(EMPTY_SETTINGS));
    }
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

    private volatile TransportServiceAdapter transportServiceAdapter;

    private volatile BoundTransportAddress boundAddress;

    public NettyTransport(ThreadPool threadPool) {
        this(EMPTY_SETTINGS, threadPool, new NetworkService(EMPTY_SETTINGS));
    }
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

    public NettyTransport(ThreadPool threadPool) {
        this(EMPTY_SETTINGS, threadPool, new NetworkService(EMPTY_SETTINGS));
    }

    public NettyTransport(Settings settings, ThreadPool threadPool) {
        this(settings, threadPool, new NetworkService(settings));
    }
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

    private MockBigArrays bigArrays;
    private CustomNettyHttpServerTransport httpServerTransport;

    @Before
    public void setup() throws Exception {
        networkService = new NetworkService(ImmutableSettings.EMPTY);
        threadPool = new ThreadPool("test");
        mockPageCacheRecycler = new MockPageCacheRecycler(ImmutableSettings.EMPTY, threadPool);
        bigArrays = new MockBigArrays(ImmutableSettings.EMPTY, mockPageCacheRecycler, new NoneCircuitBreakerService());
    }
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

        int endPort = startPort + 10;
        settings = ImmutableSettings.builder().put(settings).put("transport.tcp.port", startPort + "-" + endPort).build();

        ThreadPool threadPool = new ThreadPool(getClass().getName());
        ClusterName clusterName = new ClusterName("test");
        NetworkService networkService = new NetworkService(settings);
        ElectMasterService electMasterService = new ElectMasterService(settings);

        NettyTransport transportA = new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT);
        final TransportService transportServiceA = new TransportService(transportA, threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("UZP_A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

        final byte[] payload = new byte[(int) payloadSize.bytes()];

        Settings settings = ImmutableSettings.settingsBuilder()
                .build();

        NetworkService networkService = new NetworkService(settings);

        final ThreadPool threadPool = new ThreadPool("BenchmarkNettyLargeMessages");
        final TransportService transportServiceServer = new TransportService(new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT), threadPool).start();
        final TransportService transportServiceClient = new TransportService(new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT), threadPool).start();
View Full Code Here

Examples of org.elasticsearch.common.network.NetworkService

    private final AtomicInteger pingIdGenerator = new AtomicInteger();
    private final Map<Integer, PingCollection> receivedResponses = newConcurrentMap();

    public MulticastZenPing(ThreadPool threadPool, TransportService transportService, ClusterName clusterName, Version version) {
        this(EMPTY_SETTINGS, threadPool, transportService, clusterName, new NetworkService(EMPTY_SETTINGS), version);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.