public final class DiskList<E extends org.apache.hadoop.io.Writable> extends AbstractList<E> implements Iterable<E>, AutoCloseable, Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
DiskList.IORuntimeException |
modCount| Constructor and Description |
|---|
DiskList(String path)
Opens a new disk list at the given path.
|
DiskList(String path,
E reusableElement)
Opens a new disk list at the given path.
|
DiskList(String path,
int bufferSize)
Opens a new disk list at the given path with the given buffersize.
|
DiskList(String path,
int bufferSize,
E reusableElement)
Opens a new disk list at the given path with the given buffersize.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element)
Writes the given element to the disk.
|
void |
close()
Closes read and write, also deletes the file.
|
E |
get(int index) |
de.jungblut.datastructure.DiskList.State |
getCurrentState() |
Iterator<E> |
iterator() |
void |
openRead()
Opens for a read, closes the write implicitly.
|
E |
poll(E element)
Polls the next element from the input stream.
|
int |
size() |
add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratoraddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic DiskList(String path) throws IOException
BufferedOutputStream.IOExceptionpublic DiskList(String path, int bufferSize) throws IOException
IOExceptionpublic DiskList(String path, E reusableElement) throws IOException
BufferedOutputStream. IOExceptionpublic DiskList(String path, int bufferSize, E reusableElement) throws IOException
IOExceptionpublic boolean add(E element)
DiskList.IORuntimeException
in case of IO failure.add in interface Collection<E extends org.apache.hadoop.io.Writable>add in interface List<E extends org.apache.hadoop.io.Writable>add in class AbstractList<E extends org.apache.hadoop.io.Writable>public void openRead()
throws IOException
IOExceptionpublic E poll(E element) throws IOException
element - the element to fill.IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic de.jungblut.datastructure.DiskList.State getCurrentState()
public int size()
size in interface Collection<E extends org.apache.hadoop.io.Writable>size in interface List<E extends org.apache.hadoop.io.Writable>size in class AbstractCollection<E extends org.apache.hadoop.io.Writable>public Iterator<E> iterator()
iterator in interface Iterable<E extends org.apache.hadoop.io.Writable>iterator in interface Collection<E extends org.apache.hadoop.io.Writable>iterator in interface List<E extends org.apache.hadoop.io.Writable>iterator in class AbstractList<E extends org.apache.hadoop.io.Writable>Copyright © 2016. All rights reserved.