Java Code Examples for org.apache.hadoop.fs.swift.exceptions.SwiftConnectionClosedException

The following examples show how to use org.apache.hadoop.fs.swift.exceptions.SwiftConnectionClosedException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop   Source File: StrictBufferedFSInputStream.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void seek(long pos) throws IOException {
  if (pos < 0) {
    throw new EOFException(FSExceptionMessages.NEGATIVE_SEEK);
  }
  if (in == null) {
    throw new SwiftConnectionClosedException(FSExceptionMessages.STREAM_IS_CLOSED);
  }
  super.seek(pos);
}
 
Example 2
Source Project: big-c   Source File: StrictBufferedFSInputStream.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void seek(long pos) throws IOException {
  if (pos < 0) {
    throw new EOFException(FSExceptionMessages.NEGATIVE_SEEK);
  }
  if (in == null) {
    throw new SwiftConnectionClosedException(FSExceptionMessages.STREAM_IS_CLOSED);
  }
  super.seek(pos);
}
 
Example 3
Source Project: sahara-extra   Source File: StrictBufferedFSInputStream.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void seek(long pos) throws IOException {
  if (pos < 0) {
    throw new IOException("Negative position");
  }
  if (in == null) {
    throw new SwiftConnectionClosedException("Stream closed");
  }
  super.seek(pos);
}
 
Example 4
Source Project: hadoop   Source File: HttpInputStreamWithRelease.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Assume that the connection is not released: throws an exception if it is
 * @throws SwiftConnectionClosedException
 */
private synchronized void assumeNotReleased() throws SwiftConnectionClosedException {
  if (released || inStream == null) {
    throw new SwiftConnectionClosedException(reasonClosed);
  }
}
 
Example 5
Source Project: hadoop   Source File: SwiftNativeOutputStream.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * check that the output stream is open
 *
 * @throws SwiftException if it is not
 */
private synchronized void verifyOpen() throws SwiftException {
  if (closed) {
    throw new SwiftConnectionClosedException();
  }
}
 
Example 6
Source Project: hadoop   Source File: SwiftNativeInputStream.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Assume that the connection is not closed: throws an exception if it is
 * @throws SwiftConnectionClosedException
 */
private void verifyOpen() throws SwiftConnectionClosedException {
  if (httpStream == null) {
    throw new SwiftConnectionClosedException(reasonClosed);
  }
}
 
Example 7
Source Project: big-c   Source File: HttpInputStreamWithRelease.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Assume that the connection is not released: throws an exception if it is
 * @throws SwiftConnectionClosedException
 */
private synchronized void assumeNotReleased() throws SwiftConnectionClosedException {
  if (released || inStream == null) {
    throw new SwiftConnectionClosedException(reasonClosed);
  }
}
 
Example 8
Source Project: big-c   Source File: SwiftNativeOutputStream.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * check that the output stream is open
 *
 * @throws SwiftException if it is not
 */
private synchronized void verifyOpen() throws SwiftException {
  if (closed) {
    throw new SwiftConnectionClosedException();
  }
}
 
Example 9
Source Project: big-c   Source File: SwiftNativeInputStream.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Assume that the connection is not closed: throws an exception if it is
 * @throws SwiftConnectionClosedException
 */
private void verifyOpen() throws SwiftConnectionClosedException {
  if (httpStream == null) {
    throw new SwiftConnectionClosedException(reasonClosed);
  }
}
 
Example 10
Source Project: sahara-extra   Source File: HttpInputStreamWithRelease.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Assume that the connection is not released: throws an exception if it is
 * @throws SwiftConnectionClosedException
 */
private synchronized void assumeNotReleased() throws SwiftConnectionClosedException {
  if (released || inStream == null) {
    throw new SwiftConnectionClosedException(reasonClosed);
  }
}
 
Example 11
Source Project: sahara-extra   Source File: SwiftNativeInputStream.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Assume that the connection is not closed: throws an exception if it is
 * @throws SwiftConnectionClosedException
 */
private void verifyOpen() throws SwiftConnectionClosedException {
  if (httpStream == null) {
    throw new SwiftConnectionClosedException(reasonClosed);
  }
}