com.amazon.redshift.core.v3

## Class CopyOperationImpl

- java.lang.Object
- - com.amazon.redshift.core.v3.CopyOperationImpl

All Implemented Interfaces:
  CopyOperation

Direct Known Subclasses:
  CopyDualImpl, CopyInImpl, CopyOutImpl

    public abstract class CopyOperationImpl
    extends Object
    implements CopyOperation

### Constructor Summary

Constructors
Constructor and Description
`CopyOperationImpl()`

### Method Summary

Methods
`void` `cancelCopy()` Cancels this copy operation, discarding any exchanged data.
`int` `getFieldCount()`
`int` `getFieldFormat(int field)`
`int` `getFormat()`
`long` `getHandledRowCount()` After successful end of copy, returns the number of database records handled in that operation.
`void` `handleCommandStatus(String status)`
`protected abstract void` `handleCopydata(byte[] data)` Consume received copy data.
`boolean` `isActive()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CopyOperationImpl

    public CopyOperationImpl()

### Method Detail

#### cancelCopy

    public void cancelCopy()
                    throws SQLException

Description copied from interface: `CopyOperation`
Cancels this copy operation, discarding any exchanged data.

Specified by:
  `cancelCopy` in interface `CopyOperation`
Throws:
  `SQLException` - if cancelling fails

#### getFieldCount

    public int getFieldCount()

Specified by:
  `getFieldCount` in interface `CopyOperation`
Returns:
  number of fields in each row for this operation

#### getFieldFormat

    public int getFieldFormat(int field)

Specified by:
  `getFieldFormat` in interface `CopyOperation`
Parameters:
  `field` - number of field (0..fieldCount()-1)
Returns:
  format of requested field: 0 = textual, 1 = binary

#### getFormat

    public int getFormat()

Specified by:
  `getFormat` in interface `CopyOperation`
Returns:
  overall format of each row: 0 = textual, 1 = binary

#### isActive

    public boolean isActive()

Specified by:
  `isActive` in interface `CopyOperation`
Returns:
  is connection reserved for this Copy operation?

#### handleCommandStatus

    public void handleCommandStatus(String status)
                             throws RedshiftException

Throws:
  `RedshiftException`

#### handleCopydata

    protected abstract void handleCopydata(byte[] data)
                                    throws RedshiftException

Consume received copy data.

Parameters:
  `data` - data that was receive by copy protocol
Throws:
  `RedshiftException` - if some internal problem occurs

#### getHandledRowCount

    public long getHandledRowCount()

Description copied from interface: `CopyOperation`
After successful end of copy, returns the number of database records handled in that operation. Unimplemented in Redshift server. Returns -1.

Specified by:
  `getHandledRowCount` in interface `CopyOperation`
Returns:
  number of handled rows or -1