blob: de163423df33ad355004eef591ddced13fbba524 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.hyracks.api.io;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.Executor;
import org.apache.hyracks.api.exceptions.HyracksDataException;
public interface IIOManager {
public enum FileReadWriteMode {
READ_ONLY,
READ_WRITE
}
public enum FileSyncMode {
METADATA_SYNC_DATA_SYNC,
METADATA_ASYNC_DATA_SYNC,
METADATA_ASYNC_DATA_ASYNC
}
public List<IODeviceHandle> getIODevices();
public IFileHandle open(FileReference fileRef, FileReadWriteMode rwMode, FileSyncMode syncMode)
throws HyracksDataException;
public int syncWrite(IFileHandle fHandle, long offset, ByteBuffer data) throws HyracksDataException;
public int syncRead(IFileHandle fHandle, long offset, ByteBuffer data) throws HyracksDataException;
public IIOFuture asyncWrite(IFileHandle fHandle, long offset, ByteBuffer data);
public IIOFuture asyncRead(IFileHandle fHandle, long offset, ByteBuffer data);
public void close(IFileHandle fHandle) throws HyracksDataException;
public void sync(IFileHandle fileHandle, boolean metadata) throws HyracksDataException;
public void setExecutor(Executor executor);
}