| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | FileNioMemData.
Represents a compressed item. |
| pack-priv static class | FileNioMemData.
This small cache compresses the data if an element leaves the cache. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| private volatile AtomicReference | |
| private static final int | |
| private final boolean | |
| private static final ThreadLocal | COMPRESS_OUT_BUF_THREAD_LOCAL
the output buffer when compressing |
| private static final ByteBuffer | |
| private final FileNioMemData. | |
| private final float | |
| private boolean | |
| private boolean | |
| private long | |
| private volatile long | |
| private static final ThreadLocal | |
| private String | |
| pack-priv final int | nameHashCode
The hash code of the name. |
| private final ReentrantReadWriteLock | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv boolean | |
| private void | |
| pack-priv void | |
| private ByteBuffer | |
| pack-priv long | |
| pack-priv String | |
| pack-priv long | |
| pack-priv synchronized boolean | |
| pack-priv synchronized boolean | |
| pack-priv long | Returns: the new positionthe position pos, ByteBuffer the byte array b, int the offset within the byte array off, int the number of bytes len, boolean true for writing write)Read or write. |
| pack-priv void | |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv void | |
| pack-priv synchronized void |
| BLOCK_SIZE | back to summary |
|---|---|
| private static final int BLOCK_SIZE | |
| BLOCK_SIZE_MASK | back to summary |
|---|---|
| private static final int BLOCK_SIZE_MASK | |
| BLOCK_SIZE_SHIFT | back to summary |
|---|---|
| private static final int BLOCK_SIZE_SHIFT | |
| buffers | back to summary |
|---|---|
| private volatile AtomicReference<ByteBuffer>[] buffers | |
| CACHE_MIN_SIZE | back to summary |
|---|---|
| private static final int CACHE_MIN_SIZE | |
| compress | back to summary |
|---|---|
| private final boolean compress | |
| COMPRESS_OUT_BUF_THREAD_LOCAL | back to summary |
|---|---|
| private static final ThreadLocal<byte[]> COMPRESS_OUT_BUF_THREAD_LOCAL the output buffer when compressing | |
| COMPRESSED_EMPTY_BLOCK | back to summary |
|---|---|
| private static final ByteBuffer COMPRESSED_EMPTY_BLOCK | |
| compressLaterCache | back to summary |
|---|---|
| private final FileNioMemData. | |
| compressLaterCachePercent | back to summary |
|---|---|
| private final float compressLaterCachePercent | |
| isLockedExclusive | back to summary |
|---|---|
| private boolean isLockedExclusive | |
| isReadOnly | back to summary |
|---|---|
| private boolean isReadOnly | |
| lastModified | back to summary |
|---|---|
| private long lastModified | |
| length | back to summary |
|---|---|
| private volatile long length | |
| LZF_THREAD_LOCAL | back to summary |
|---|---|
| private static final ThreadLocal<CompressLZF> LZF_THREAD_LOCAL | |
| name | back to summary |
|---|---|
| private String name | |
| nameHashCode | back to summary |
|---|---|
| pack-priv final int nameHashCode The hash code of the name. | |
| rwLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock rwLock | |
| sharedLockCount | back to summary |
|---|---|
| private int sharedLockCount | |
| FileNioMemData | back to summary |
|---|---|
pack-priv FileNioMemData(String name, boolean compress, float compressLaterCachePercent)
| |
| addToCompressLaterCache | back to summary |
|---|---|
| private void addToCompressLaterCache(int page) | |
| canWrite | back to summary |
|---|---|
| pack-priv boolean canWrite() Check whether writing is allowed.
| |
| changeLength | back to summary |
|---|---|
private void changeLength(long len)
| |
| compressPage | back to summary |
|---|---|
| pack-priv void compressPage(int page) Compress the data in a byte array.
| |
| expandPage | back to summary |
|---|---|
| private ByteBuffer expandPage(int page) | |
| getLastModified | back to summary |
|---|---|
| pack-priv long getLastModified() Get the last modified time.
| |
| getName | back to summary |
|---|---|
| pack-priv String getName() Get the file name
| |
| length | back to summary |
|---|---|
| pack-priv long length() Get the file length.
| |
| lockExclusive | back to summary |
|---|---|
| pack-priv synchronized boolean lockExclusive() Lock the file in exclusive mode if possible.
| |
| lockShared | back to summary |
|---|---|
| pack-priv synchronized boolean lockShared() Lock the file in shared mode if possible.
| |
| readWrite | back to summary |
|---|---|
| pack-priv long readWrite(long pos, ByteBuffer b, int off, int len, boolean write) Read or write.
| |
| setName | back to summary |
|---|---|
| pack-priv void setName(String name) Set the file name.
| |
| setReadOnly | back to summary |
|---|---|
| pack-priv boolean setReadOnly() Set the read-only flag.
| |
| touch | back to summary |
|---|---|
| pack-priv void touch(boolean openReadOnly) Update the last modified time.
| |
| truncate | back to summary |
|---|---|
| pack-priv void truncate(long newLength) Truncate the file.
| |
| unlock | back to summary |
|---|---|
| pack-priv synchronized void unlock() Unlock the file. | |
| Modifier and Type | Field and Description |
|---|---|
| public final FileNioMemData | data
The file data. |
| public final int | page
The page to compress. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public int |
| data | back to summary |
|---|---|
| public final FileNioMemData data The file data. | |
| page | back to summary |
|---|---|
| public final int page The page to compress. | |
| CompressItem | back to summary |
|---|---|
| public CompressItem(FileNioMemData data, int page) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private int | size
Hides java. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Overrides java. Implements java. Associates the specified value with the specified key in this map (optional operation). |
| protected boolean | removeEldestEntry(Map.
The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed if this
method returns eldesttrue. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.Overrides java. Returns |
| public void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| size | back to summary |
|---|---|
| private int size Hides java. | |
| CompressLaterCache | back to summary |
|---|---|
| pack-priv CompressLaterCache(int size) | |
| put | back to summary |
|---|---|
| public synchronized V put(K key, V value) Overrides java. Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| removeEldestEntry | back to summary |
|---|---|
| protected boolean removeEldestEntry(Map. Overrides java. Doc from java. Returns Sample use: this override will allow the map to grow up to 100 entries and then delete the eldest entry each time a new entry is added, maintaining a steady state of 100 entries.
private static final int MAX_ENTRIES = 100;
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
This method typically does not modify the map in any way,
instead allowing the map to modify itself as directed by its
return value. It is permitted for this method to modify
the map directly, but if it does so, it must return
This implementation merely returns
| |
| setCacheSize | back to summary |
|---|---|
| public void setCacheSize(int size) | |