Package org.hivedb.meta.persistence

Examples of org.hivedb.meta.persistence.HiveSemaphoreDao


  }

  public void run() {
    try {
      Schemas.install(new HiveConfigurationSchema(), uri);
      new HiveSemaphoreDao(CachingDataSourceProvider.getInstance().getDataSource(uri)).create();
    } catch (Exception e) {
      throw new HiveRuntimeException(e.getMessage(), e);
    }
  }
View Full Code Here


  }

  public void run() {
    try {
      new HiveConfigurationSchema(uri).install();
      new HiveSemaphoreDao(CachingDataSourceProvider.getInstance().getDataSource(uri)).create();
    } catch (Exception e) {
      throw new HiveRuntimeException(e.getMessage(), e);
    }
  }
View Full Code Here

    }
    return cachedDataSource;
  }

  private int getLatestRevision() {
    return new HiveSemaphoreDao(getDataSource()).get().getRevision();
  }
View Full Code Here

    for(Observer o : observers) {
      assertTrue(((DumbObserver) o).isChanged());
      ((DumbObserver) o).setChanged(false);
    }
   
    HiveSemaphoreDao hsd = new HiveSemaphoreDao(getDataSource(getConnectString(getHiveDatabaseName())));
    hsd.incrementAndPersist();
   
    daemon.detectChanges();
    for(Observer o : observers) {
      assertTrue(((DumbObserver) o).isChanged());
    }
View Full Code Here

@Config("hive_default")
public class TestHiveSemaphorePersistence extends HiveTest {
 
  @Test
  public void testUpdate() throws Exception {
    HiveSemaphoreDao hsd = new HiveSemaphoreDao(getDataSource(getConnectString(getHiveDatabaseName())));
    HiveSemaphore hs = hsd.create();
    hs.incrementRevision();
    hsd.update(hs);
   
    HiveSemaphore hs2 = hsd.get();
    Assert.assertEquals(hs.getRevision(),hs2.getRevision());
    Assert.assertEquals(hs.getStatus(),hs2.getStatus());
  }
View Full Code Here

TOP

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

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.