Package org.openstreetmap.osmosis.apidb.v0_6

Examples of org.openstreetmap.osmosis.apidb.v0_6.ApidbTruncator


   * @param dbCtx
   *            Used to access the database.
   */
    protected void runImpl(DatabaseContext2 dbCtx) {
      try {
        AllEntityDao entityDao;
        ReleasableIterator<EntityContainer> reader;
       
        sink.initialize(Collections.<String, Object>emptyMap());
       
          new SchemaVersionValidator(loginCredentials, preferences)
                  .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
         
          sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
          reader = entityDao.getCurrent();
          try {
            while (reader.hasNext()) {
              sink.process(reader.next());
            }
           
View Full Code Here


   * @param dbCtx
   *            Used to access the database.
   */
    protected void runImpl(DatabaseContext2 dbCtx) {
      try {
        AllEntityDao entityDao;
        ReleasableIterator<ChangeContainer> reader;
       
        changeSink.initialize(Collections.<String, Object>emptyMap());
       
          new SchemaVersionValidator(loginCredentials, preferences)
                  .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
         
          reader = entityDao.getHistory(intervalBegin, intervalEnd);
          if (!fullHistory) {
            reader = new DeltaToDiffReader(reader);
          }
          try {
            while (reader.hasNext()) {
View Full Code Here

   * @param dbCtx
   *            Used to access the database.
   */
    protected void runImpl(DatabaseContext2 dbCtx) {
      try {
        AllEntityDao entityDao;
        ReleasableIterator<EntityContainer> reader;
       
        sink.initialize(Collections.<String, Object>emptyMap());
       
          new SchemaVersionValidator(loginCredentials, preferences)
                  .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());

          sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
          reader = new EntitySnapshotReader(entityDao.getHistory(), snapshotInstant);
          try {
            while (reader.hasNext()) {
              sink.process(reader.next());
            }
           
View Full Code Here

     * @param populateCurrentTables If true, the current tables will be populated as well as history
     *        tables.
     */
    public ApidbChangeWriter(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences,
            boolean populateCurrentTables) {
        changeWriter = new ChangeWriter(loginCredentials, populateCurrentTables);
        actionWriterMap = new HashMap<ChangeAction, ActionChangeWriter>();
        actionWriterMap.put(ChangeAction.Create, new ActionChangeWriter(changeWriter, ChangeAction.Create));
        actionWriterMap.put(ChangeAction.Modify, new ActionChangeWriter(changeWriter, ChangeAction.Modify));
        actionWriterMap.put(ChangeAction.Delete, new ActionChangeWriter(changeWriter, ChangeAction.Delete));

View Full Code Here

    public ApidbWriter(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences, boolean lockTables,
            boolean populateCurrentTables) {
        dbCtx = new DatabaseContext(loginCredentials);
       
        userManager = new UserManager(dbCtx);
        changesetManager = new ChangesetManager(dbCtx);

        schemaVersionValidator = new SchemaVersionValidator(loginCredentials, preferences);

        this.lockTables = lockTables;
        this.populateCurrentTables = populateCurrentTables;
View Full Code Here

         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());
         
          reader = entityDao.getHistory(intervalBegin, intervalEnd);
          if (!fullHistory) {
            reader = new DeltaToDiffReader(reader);
          }
          try {
            while (reader.hasNext()) {
              changeSink.process(reader.next());
            }
View Full Code Here

                  .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
         
          entityDao = new AllEntityDao(dbCtx.getJdbcTemplate());

          sink.process(new BoundContainer(new Bound("Osmosis " + OsmosisConstants.VERSION)));
          reader = new EntitySnapshotReader(entityDao.getHistory(), snapshotInstant);
          try {
            while (reader.hasNext()) {
              sink.process(reader.next());
            }
           
View Full Code Here

        minWayId = Long.MAX_VALUE;
        maxRelationId = Long.MIN_VALUE;
        minRelationId = Long.MAX_VALUE;

        tileCalculator = new TileCalculator();
        memberTypeRenderer = new MemberTypeRenderer();

        initialized = false;
    }
View Full Code Here

   * @param dbCtx
   *            Used to access the database.
   */
    protected void runImpl(DatabaseContext2 dbCtx) {
    Replicator replicator;
    ReplicationSource source;
    TransactionManager txnSnapshotLoader;
    SystemTimeLoader systemTimeLoader;
   
    new SchemaVersionValidator(loginCredentials, preferences)
        .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
View Full Code Here

   *
   * @param dbCtx
   *            Used to access the database.
   */
    protected void runImpl(DatabaseContext2 dbCtx) {
    Replicator replicator;
    ReplicationSource source;
    TransactionManager txnSnapshotLoader;
    SystemTimeLoader systemTimeLoader;
   
    new SchemaVersionValidator(loginCredentials, preferences)
        .validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
   
    source = new AllEntityDao(dbCtx.getJdbcTemplate());
    txnSnapshotLoader = new TransactionDao(dbCtx);
    systemTimeLoader = new TimeDao(dbCtx.getJdbcTemplate());
   
    replicator = new Replicator(source, changeSink, txnSnapshotLoader, systemTimeLoader, iterations, minInterval,
        maxInterval);
   
    replicator.replicate();
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.apidb.v0_6.ApidbTruncator

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.