Package net.sf.katta.protocol.metadata.IndexMetaData

Examples of net.sf.katta.protocol.metadata.IndexMetaData.Shard


        }
      });
      for (final FileStatus fileStatus : listStatus) {
        String shardPath = fileStatus.getPath().toString();
        if (fileStatus.isDir() || shardPath.endsWith(".zip")) {
          shards.add(new Shard(createShardName(indexName, shardPath), shardPath));
        }
      }
    } catch (final IOException e) {
      throw new IndexDeployException(ErrorType.INDEX_NOT_ACCESSIBLE, "could not access index path: " + indexPathString,
              e);
View Full Code Here


  }

  @Test(timeout = 70000)
  public void testIndexManagement() throws Exception {
    IndexMetaData indexMD = new IndexMetaData("index1", "indexPath", 2);
    indexMD.getShards().add(new Shard(AbstractIndexOperation.createShardName(indexMD.getName(), "path1"), "path1"));
    Node node = Mocks.mockNode();

    assertNull(_protocol.getIndexMD("index1"));
    assertEquals(0, _protocol.getIndices().size());
View Full Code Here

  public void testAddRemoveIndexForSearching() throws Exception {
    InteractionProtocol protocol = mock(InteractionProtocol.class);
    Client client = new Client(ISleepServer.class, new DefaultNodeSelectionPolicy(), protocol,
            new ClientConfiguration());
    IndexMetaData indexMD = new IndexMetaData("index1", "path", 1);
    indexMD.getShards().add(new Shard("shard1", "path"));
    indexMD.getShards().add(new Shard("shard2", "path"));
    client.addIndexForSearching(indexMD);
    verify(protocol, times(2)).registerChildListener(eq(client), eq(PathDef.SHARD_TO_NODES), anyString(),
            any(IAddRemoveListener.class));

    client.removeIndex(indexMD.getName());
View Full Code Here

  public void testAddRemoveIndexForWatching() throws Exception {
    InteractionProtocol protocol = mock(InteractionProtocol.class);
    Client client = new Client(ISleepServer.class, new DefaultNodeSelectionPolicy(), protocol,
            new ClientConfiguration());
    IndexMetaData indexMD = new IndexMetaData("index1", "path", 1);
    indexMD.getShards().add(new Shard("shard1", "path"));
    indexMD.getShards().add(new Shard("shard2", "path"));
    client.addIndexForWatching(indexMD.getName());
    verify(protocol, times(1)).registerDataListener(eq(client), eq(PathDef.INDICES_METADATA), anyString(),
            any(IZkDataListener.class));

    client.removeIndex(indexMD.getName());
View Full Code Here

TOP

Related Classes of net.sf.katta.protocol.metadata.IndexMetaData.Shard

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.