public class COUNTER extends Protocol
CounterService
to provide a distributed atomic counterModifier and Type | Class and Description |
---|---|
protected static class |
COUNTER.AddAndGetRequest |
protected static class |
COUNTER.BooleanResponse |
protected static class |
COUNTER.CompareAndSetRequest |
static class |
COUNTER.CounterHeader |
protected class |
COUNTER.CounterImpl |
protected static class |
COUNTER.DeleteRequest |
protected static class |
COUNTER.ExceptionResponse |
protected static class |
COUNTER.GetOrCreateRequest |
protected static class |
COUNTER.GetOrCreateResponse |
protected static class |
COUNTER.ReconcileRequest |
protected static class |
COUNTER.ReconcileResponse |
protected class |
COUNTER.ReconciliationTask |
protected static class |
COUNTER.Request |
protected static class |
COUNTER.RequestType |
protected static class |
COUNTER.ResendPendingRequests |
protected static class |
COUNTER.Response |
protected static class |
COUNTER.ResponseType |
protected static class |
COUNTER.SetRequest |
protected static class |
COUNTER.SimpleRequest |
protected static class |
COUNTER.SimpleResponse
Response without data
|
protected static class |
COUNTER.UpdateRequest |
protected static class |
COUNTER.ValueResponse |
protected static class |
COUNTER.VersionedValue |
Modifier and Type | Field and Description |
---|---|
protected List<Address> |
backup_coords
Backup coordinators.
|
protected boolean |
bypass_bundling |
protected Address |
coord
The address of the cluster coordinator.
|
protected ConcurrentMap<String,COUNTER.VersionedValue> |
counters |
protected boolean |
discard_requests
Set to true during reconciliation process, will cause all requests to be discarded
|
protected Address |
local_addr |
protected int |
num_backups |
protected Map<Owner,Tuple<COUNTER.Request,Promise>> |
pending_requests |
protected COUNTER.ReconciliationTask |
reconciliation_task |
protected Future<?> |
reconciliation_task_future |
protected long |
reconciliation_timeout |
protected static byte |
REQUEST |
protected static byte |
RESPONSE |
protected long |
timeout |
protected View |
view |
Constructor and Description |
---|
COUNTER() |
Modifier and Type | Method and Description |
---|---|
protected static COUNTER.Request |
createRequest(COUNTER.RequestType type) |
protected static COUNTER.Response |
createResponse(COUNTER.ResponseType type) |
void |
deleteCounter(String name)
Sent asynchronously - we don't wait for an ack
|
Object |
down(Event evt)
An event is to be sent down the stack.
|
protected static String |
dump(String[] names,
long[] values,
long[] versions) |
String |
dumpPendingRequests() |
String |
getAddress() |
String |
getBackupCoords() |
boolean |
getBypassBundling() |
protected COUNTER.VersionedValue |
getCounter(String name) |
Counter |
getOrCreateCounter(String name,
long initial_value) |
protected Owner |
getOwner() |
String |
getView() |
protected void |
handleRequest(COUNTER.Request req,
Address sender) |
protected void |
handleResponse(COUNTER.Response rsp,
Address sender) |
protected void |
handleView(View view) |
String |
printCounters() |
protected static long[] |
readReconciliationLongs(DataInput in,
int len) |
protected static String[] |
readReconciliationNames(DataInput in,
int len) |
protected static COUNTER.Request |
requestFromBuffer(byte[] buf,
int offset,
int length) |
protected static Buffer |
requestToBuffer(COUNTER.Request req) |
protected static COUNTER.RequestType |
requestToRequestType(COUNTER.Request req) |
protected static COUNTER.Response |
responseFromBuffer(byte[] buf,
int offset,
int length) |
protected static Buffer |
responseToBuffer(COUNTER.Response rsp) |
protected static COUNTER.ResponseType |
responseToResponseType(COUNTER.Response rsp) |
protected void |
send(Address dest,
Buffer buffer) |
protected void |
sendCounterNotFoundExceptionResponse(Address dest,
Owner owner,
String counter_name) |
protected void |
sendRequest(Address dest,
COUNTER.Request req) |
protected void |
sendResponse(Address dest,
COUNTER.Response rsp) |
void |
setBypassBundling(boolean bypass_bundling) |
protected void |
startReconciliationTask() |
protected void |
stopReconciliationTask() |
protected static Streamable |
streamableFromBuffer(byte[] buf,
int offset,
int length) |
protected static Buffer |
streamableToBuffer(byte req_or_rsp,
byte type,
Streamable obj) |
Object |
up(Event evt)
An event was received from the layer below.
|
protected void |
updateBackups(String name,
long value,
long version) |
protected static void |
writeReconciliation(DataOutput out,
String[] names,
long[] values,
long[] versions) |
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, init, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop
protected boolean bypass_bundling
protected long timeout
protected long reconciliation_timeout
protected int num_backups
protected Address local_addr
protected boolean discard_requests
protected View view
protected Address coord
protected List<Address> backup_coords
protected Future<?> reconciliation_task_future
protected COUNTER.ReconciliationTask reconciliation_task
protected final ConcurrentMap<String,COUNTER.VersionedValue> counters
protected final Map<Owner,Tuple<COUNTER.Request,Promise>> pending_requests
protected static final byte REQUEST
protected static final byte RESPONSE
protected static COUNTER.RequestType requestToRequestType(COUNTER.Request req)
protected static COUNTER.ResponseType responseToResponseType(COUNTER.Response rsp)
public boolean getBypassBundling()
public void setBypassBundling(boolean bypass_bundling)
public String getAddress()
public String getView()
public String getBackupCoords()
public void deleteCounter(String name)
public Object down(Event evt)
Protocol
down_prot.down()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using up_prot.up()
.public Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.protected void handleRequest(COUNTER.Request req, Address sender)
protected COUNTER.VersionedValue getCounter(String name)
protected void handleResponse(COUNTER.Response rsp, Address sender)
public String printCounters()
public String dumpPendingRequests()
protected void handleView(View view)
protected Owner getOwner()
protected void sendRequest(Address dest, COUNTER.Request req)
protected void sendResponse(Address dest, COUNTER.Response rsp)
protected void updateBackups(String name, long value, long version)
protected void sendCounterNotFoundExceptionResponse(Address dest, Owner owner, String counter_name)
protected static Buffer requestToBuffer(COUNTER.Request req) throws Exception
Exception
protected static Buffer responseToBuffer(COUNTER.Response rsp) throws Exception
Exception
protected static Buffer streamableToBuffer(byte req_or_rsp, byte type, Streamable obj) throws Exception
Exception
protected static Streamable streamableFromBuffer(byte[] buf, int offset, int length) throws Exception
Exception
protected static final COUNTER.Request requestFromBuffer(byte[] buf, int offset, int length) throws Exception
Exception
protected static COUNTER.Request createRequest(COUNTER.RequestType type)
protected static final COUNTER.Response responseFromBuffer(byte[] buf, int offset, int length) throws Exception
Exception
protected static COUNTER.Response createResponse(COUNTER.ResponseType type)
protected void startReconciliationTask()
protected void stopReconciliationTask()
protected static void writeReconciliation(DataOutput out, String[] names, long[] values, long[] versions) throws Exception
Exception
protected static String[] readReconciliationNames(DataInput in, int len) throws Exception
Exception
protected static long[] readReconciliationLongs(DataInput in, int len) throws Exception
Exception
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.