public class MemBucket extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MemBucket.MemBucketState |
Modifier and Type | Field and Description |
---|---|
protected int |
id |
protected int |
maxRecordCount |
protected long |
maxSize |
protected long |
size |
Constructor and Description |
---|
MemBucket(int id,
long maxSize,
int maxRecordCount) |
Modifier and Type | Method and Description |
---|---|
boolean |
addRecord(LogRecord record) |
int |
getCount() |
int |
getId() |
List<LogRecord> |
getRecords() |
long |
getSize() |
MemBucket.MemBucketState |
getState() |
void |
setState(MemBucket.MemBucketState state) |
List<LogRecord> |
shrinkToSize(long newSize,
int newCount)
Shrinks current bucket to the newSize
|
String |
toString() |
protected final int id
protected final long maxSize
protected final int maxRecordCount
protected long size
public int getId()
public long getSize()
public int getCount()
public MemBucket.MemBucketState getState()
public void setState(MemBucket.MemBucketState state)
public boolean addRecord(LogRecord record)
public List<LogRecord> shrinkToSize(long newSize, int newCount)
newSize
- expected max size of a bucket inclusivelyCopyright © 2015. All rights reserved.