Package net.sf.katta.client

Examples of net.sf.katta.client.Client


    super(2);
  }

  @Test(timeout = 20000)
  public void testAddIndex_WithSlowProxyEstablishment() throws Exception {
    Client client = new Client(ILuceneServer.class, _protocol);
    INodeProxyManager proxyCreator = client.getProxyManager();
    INodeProxyManager proxyCreatorSpy = spy(proxyCreator);
    PauseAnswer<Void> pauseAnswer = new PauseAnswer<Void>(null);
    doAnswer(new ChainedAnswer(pauseAnswer, new CallsRealMethods())).when(proxyCreatorSpy).getProxy(anyString(),
            eq(true));
    client.setProxyCreator(proxyCreatorSpy);
    IndexMetaData indexMD = deployIndex(INDEX_NAME, INDEX_FILE, getNodeCount());
    pauseAnswer.joinExecutionBegin();
    assertThat(client.getSelectionPolicy().getShardNodes(indexMD.getShards().iterator().next().getName())).isEmpty();
    assertThat(client.getIndices()).isEmpty();
    pauseAnswer.resumeExecution(true);
    while (client.getSelectionPolicy().getShardNodes(indexMD.getShards().iterator().next().getName()).isEmpty()) {
      Thread.sleep(200);
    }
    assertThat(client.getSelectionPolicy().getShardNodes(indexMD.getShards().iterator().next().getName())).isNotEmpty();
    assertThat(client.getIndices()).isNotEmpty();
  }
View Full Code Here


  protected final static Logger LOG = Logger.getLogger(SleepClient.class);

  private Client _client;

  public SleepClient(final INodeSelectionPolicy nodeSelectionPolicy) {
    _client = new Client(ISleepServer.class, nodeSelectionPolicy);
  }
View Full Code Here

  public SleepClient(final INodeSelectionPolicy nodeSelectionPolicy) {
    _client = new Client(ISleepServer.class, nodeSelectionPolicy);
  }

  public SleepClient() {
    _client = new Client(ISleepServer.class);
  }
View Full Code Here

  public SleepClient() {
    _client = new Client(ISleepServer.class);
  }

  public SleepClient(final ZkConfiguration config) {
    _client = new Client(ISleepServer.class, config);
  }
View Full Code Here

  public SleepClient(final ZkConfiguration config) {
    _client = new Client(ISleepServer.class, config);
  }

  public SleepClient(final INodeSelectionPolicy policy, final ZkConfiguration config) {
    _client = new Client(ISleepServer.class, policy, config);
  }
View Full Code Here

    _client = new Client(ISleepServer.class, policy, config);
  }

  public SleepClient(final INodeSelectionPolicy policy, final ZkConfiguration config,
          final ClientConfiguration clientConfiguration) {
    _client = new Client(ISleepServer.class, policy, config, clientConfiguration);
  }
View Full Code Here

    checkResults(startTime, QUERY_TIME, firedQueries, unexpectedResultCount, exceptions);
  }

  private void startAndStopNodes(long queryTime) throws Exception {
    Client client = new Client(ILuceneServer.class, _protocol);
    Thread.sleep(queryTime / 4);
    System.out.println("-----------------------SHUTDOWN NODE1: "
            + _protocol.getShard2NodesMap(_protocol.getShard2NodeShards()));
    System.out.println(client.getSelectionPolicy().toString());
    _miniCluster.shutdownNode(0);

    Thread.sleep(queryTime / 4);
    System.out.println("-----------------------SHUTDOWN NODE2: "
            + _protocol.getShard2NodesMap(_protocol.getShard2NodeShards()));
    System.out.println(client.getSelectionPolicy().toString());
    _miniCluster.shutdownNode(0);

    Thread.sleep(queryTime / 4);
    System.out.println("-----------------------START NEW NODE: "
            + _protocol.getShard2NodesMap(_protocol.getShard2NodeShards()));
    System.out.println(client.getSelectionPolicy().toString());
    _miniCluster.startAdditionalNode();

    System.out.println("-----------------------SHUTDOWN NEW NODE: "
            + _protocol.getShard2NodesMap(_protocol.getShard2NodeShards()));
    System.out.println(client.getSelectionPolicy().toString());
    Thread.sleep(queryTime / 2);
    _miniCluster.shutdownNode(_miniCluster.getRunningNodeCount() - 1);
  }
View Full Code Here

    IDeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
    IndexMetaData indexMD = deployClient.getIndexMetaData(INDEX1);
    deployClient.removeIndex(INDEX1);
    TestUtil.waitUntilShardsUndeployed(_protocol, indexMD);

    Client client = _client.getClient();
    assertThat(client.getIndices()).excludes((Object) INDEX_1);
    Map<String, Set<Watcher>> existWatches = getExistsWatches(client);
    assertThat(existWatches).isEmpty();

  }
View Full Code Here

  private static final long TIMEOUT = 12000;
 
  private Client kattaClient;
 
  public MapFileClient(final INodeSelectionPolicy nodeSelectionPolicy) {
    kattaClient = new Client(IMapFileServer.class, nodeSelectionPolicy);
  }
View Full Code Here

  public MapFileClient(final INodeSelectionPolicy nodeSelectionPolicy) {
    kattaClient = new Client(IMapFileServer.class, nodeSelectionPolicy);
  }

  public MapFileClient() {
    kattaClient = new Client(IMapFileServer.class);
  }
View Full Code Here

TOP

Related Classes of net.sf.katta.client.Client

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.