Package org.openstreetmap.osmosis.core

Examples of org.openstreetmap.osmosis.core.OsmosisRuntimeException


  @Override
  protected void writeSequence(ChannelHandlerContext ctx, ChannelFuture future, long sequenceNumber) {
    // We do not support sending new replication data until the previous
    // send has completed.
    if (chunkedFileChannel != null) {
      throw new OsmosisRuntimeException(
          "We cannot send new replication data until the previous write has completed");
    }
   
    if (LOG.isLoggable(Level.FINEST)) {
      LOG.finest("Sequence being written, includeData=" + includeData + ", sequenceNumber="
View Full Code Here


    int defaultTaskCount;
   
    defaultTaskCount = defaultTasks.size();
   
    if (defaultTaskCount == 0) {
      throw new OsmosisRuntimeException("No default pipes are available as input for task " + taskId + ".");
    }
   
    task = defaultTasks.pop();
   
    // Ensure the task is of the correct type.
    if (!verifyPipeType(requiredTaskType, task)) {
      throw new OsmosisRuntimeException(
          "Task " + taskId + " does not support data provided by default pipe stored at level "
          + (defaultTasks.size() + 1) + " in the default pipe stack.");
    }
   
    if (LOG.isLoggable(Level.FINE)) {
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Sink getSink(int instance) {
    if (instance != 0) {
      throw new OsmosisRuntimeException("Sink instance " + instance
          + " is not valid.");
    }
   
    return sortedEntityValidator;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public ChangeSink getChangeSink(int instance) {
    if (instance != 0) {
      throw new OsmosisRuntimeException("Change sink instance " + instance
          + " is not valid.");
    }
   
    return sortedChangeValidator;
  }
View Full Code Here

    } else if ("bzip2".equals(rawValue)) {
      result = CompressionMethod.BZip2;
    } else if ("auto".equals(rawValue)) {
      result = new CompressionMethodDeriver().deriveCompressionMethod(fileName);
    } else {
      throw new OsmosisRuntimeException(
        "Argument " + ARG_COMPRESSION_METHOD + " for task " + taskConfig.getId()
        + " must be one of none, gzip, bzip2 or auto.");
    }   
    return result;
  }
View Full Code Here

    } else if (NodeLocationStoreType.TempFile.equals(storeType)) {
      locationStore = new PersistentNodeLocationStore();
    } else if (NodeLocationStoreType.CompactTempFile.equals(storeType)) {
      locationStore = new CompactPersistentNodeLocationStore();
    } else {
      throw new OsmosisRuntimeException("The store type " + storeType + " is not recognized.");
    }
  }
View Full Code Here

            fileInputStream = new FileInputStream(configFile);

            loadedProperties.load(fileInputStream);

        } catch (IOException e) {
            throw new OsmosisRuntimeException("Unable to load properties from config file " + configFile + ".", e);
        } finally {
            if (fileInputStream != null) {
                try {
                    fileInputStream.close();
                } catch (IOException e) {
View Full Code Here

  private void initializeChunk() {
    try {
      tmpDataFile = File.createTempFile("change", ".tmp");
    } catch (IOException e) {
      throw new OsmosisRuntimeException("Unable to create replication data temp file", e);
    }
    try {
      tmpDataChannel = new FileOutputStream(tmpDataFile).getChannel();
    } catch (FileNotFoundException e) {
      throw new OsmosisRuntimeException("Unable to open chunk data temp file", e);
    }
   
    chunkInProgress = true;
  }
View Full Code Here

    } else if (NodeLocationStoreType.TempFile.equals(storeType)) {
      locationStore = new PersistentNodeLocationStore();
    } else if (NodeLocationStoreType.CompactTempFile.equals(storeType)) {
      locationStore = new CompactPersistentNodeLocationStore();
    } else {
      throw new OsmosisRuntimeException("The store type " + storeType + " is not recognized.");
    }
  }
View Full Code Here

      writeBuffer.skipBytes(bytesToWrite);
     
      bytesRemaining -= bytesToWrite;

    } catch (IOException e) {
      throw new OsmosisRuntimeException("Unable to write chunk data to temp file", e);
    }
   
    // Complete the chunk if it is complete.
    if (bytesRemaining <= 0) {
      try {
        tmpDataChannel.close();
      } catch (IOException e) {
        throw new OsmosisRuntimeException("Unable to close chunk data temp file", e);
      }

      readyFiles.add(tmpDataFile);
      tmpDataFile = null;
      chunkInProgress = false;
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.core.OsmosisRuntimeException

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.