Package org.hivedb.meta.persistence

Examples of org.hivedb.meta.persistence.NodeDao


    this.directoryProvider = directoryProvider;
  }

  public DirectoryFacade getDirectoryFacade(String hiveConfigurationUri, Assigner assigner, Lockable semaphore, PartitionDimension partitionDimension) {
    DataSource dataSource = dataSourceProvider.getDataSource(hiveConfigurationUri);
    Collection<Node> nodes = new NodeDao(dataSource).loadAll();
    return new DirectoryWrapper(
        directoryProvider.getDirectory(hiveConfigurationUri),
        assigner,
        nodes,
        partitionDimension.getResources(),
View Full Code Here


public class TestNodePersistence extends HiveTest {

  @Test
  public void testCreate() throws Exception {
    int count = getHive().getNodes().size();
    NodeDao dao = new NodeDao(getDataSource(getConnectString(getHiveDatabaseName())));
    assertEquals(count, dao.loadAll().size());

    Node full = createFullyPopulatedNode();
    Node minimal = createMinimalNode();

    dao.create(full);
    dao.create(minimal);

    List<Node> nodes = dao.loadAll();
    assertEquals(2 + count, nodes.size());

    Node fetchedFull = null;
    Node fetchedMinimal = null;
View Full Code Here

  }

  @Test
  public void testUpdate() {
    int count = getHive().getNodes().size();
    NodeDao dao = new NodeDao(getDataSource(getConnectString(getHiveDatabaseName())));
    assertEquals(count, dao.loadAll().size());

    Node full = createFullyPopulatedNode();
    Node minimal = createMinimalNode();

    dao.create(full);
    dao.create(minimal);

    full.setDatabaseName("notBlahDatabase");

    minimal.setUsername("minimus");
    minimal.setPassword("maximus");

    dao.update(full);
    dao.update(minimal);

    List<Node> nodes = dao.loadAll();
    assertEquals(2 + count, nodes.size());

    Node fetchedFull = null;
    Node fetchedMinimal = null;
View Full Code Here

  }

  @Test
  public void testDelete() {
    int count = getHive().getNodes().size();
    NodeDao dao = new NodeDao(getDataSource(getConnectString(getHiveDatabaseName())));
    assertEquals(count, dao.loadAll().size());

    Node full = createFullyPopulatedNode();
    Node minimal = createMinimalNode();

    dao.create(full);
    dao.create(minimal);

    List<Node> nodes = dao.loadAll();
    assertEquals(count + 2, nodes.size());
    for (Node n : nodes)
      dao.delete(n);

    assertEquals(0, dao.loadAll().size());
  }
View Full Code Here

TOP

Related Classes of org.hivedb.meta.persistence.NodeDao

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.