E - the type of Endpoint in the underlying network.public class RingManager<E extends Endpoint> extends RPCInvoker<RingIf,E> implements RingIf
| 修飾子とタイプ | クラスと説明 |
|---|---|
static class |
RingManager.ExecQueryReturn
an execQuery return value used by (non-scalable) range queries
|
static class |
RingManager.LinkContainer
A class used for passing a link to the closest node.
|
static class |
RingManager.RightNodeMismatch |
RPCInvoker.MethodCall| 修飾子とタイプ | フィールドと説明 |
|---|---|
static int |
DDLL_CHECK_PERIOD_L0
DDLL's left node check period for level 0 (msec)
|
static TransportId |
DEFAULT_TRANSPORT_ID |
protected static KeyComparator |
keyComp |
protected NavigableMap<Comparable<?>,RingVNode<E>> |
keyHash |
protected static org.slf4j.Logger |
logger |
protected NodeManager |
manager
DDLL node manager
|
protected MessagingFramework |
msgframe |
protected E |
myLocator |
protected PeerId |
peerId |
protected Random |
rand |
static int |
RPC_TIMEOUT |
protected StatManager |
statman |
TransportId |
transId |
channelPool, isActive, objId, POOL_CHANNEL, POOL_CHANNEL_SIZE, trans, USE_CHANNEL_FOR_ONEWAY| コンストラクタと説明 |
|---|
RingManager(TransportId transId,
ChannelTransport<E> trans)
create a Chord# instance.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
ackReceived(int msgId,
AckMessage ackMessage) |
protected boolean |
addKey(Comparable<?> rawkey)
add a key to the ring.
|
boolean |
addKey(E introducer,
Comparable<?> rawkey)
add a key to the ring.
|
protected boolean |
addKey(E introducer,
Comparable<?> rawkey,
Object... vnodeParams) |
List<? extends RingVNode<E>> |
allValidVNodes()
get all inserted RingVNode instances
|
Collection<? extends RingVNode<E>> |
allVNodes()
get all RingVNode instances
|
void |
checkLocked() |
void |
fin() |
Node.InsertPoint |
find(E introducer,
DdllKey key,
boolean accurate,
Object query,
TransOptions opts)
find a location to insert `key'.
|
Node.InsertPoint |
findImmedNeighbors(E introducer,
DdllKey key,
Object query,
TransOptions opts)
Find the contact nodes (the immediate left and right node)
for inserting a node.
|
Link |
findLeftLink(DdllKey key)
find the closest left link of `key' from the local routing table.
|
void |
fixRoutingTables(Collection<Link> failedNodes,
RQMessage parentMsg,
Collection<CircularRange<DdllKey>> ranges) |
protected NavigableMap<DdllKey,Link> |
getAvailableLinks()
gather all links from all virtual nodes.
|
Link[] |
getClosestLinks(DdllKey key)
get the closest left and right links of `key' in the local routing
table.
|
Link[] |
getLocalLinks() |
PeerId |
getPeerId()
get PeerId
|
RequestMessage |
getRequestMessageById(int replyId) |
RingIf |
getStub(E addr,
int rpcTimeout)
リモートピア上のこのオブジェクトに対応するRPCInvokerオブジェクトのメソッドを呼び出すためのstubを返す。
|
RingIf |
getStub(Endpoint dst)
リモートピア上のこのオブジェクトに対応するRPCInvokerオブジェクトのメソッドを
呼び出すためのstubを返す。
|
RingVNode<E> |
getVNode(Comparable<?> rawkey)
get RingVNode instance (for debugging only)
|
boolean |
isActive() |
Condition |
newCondition() |
protected RingVNode<E> |
newVNode(Comparable<?> rawkey,
Object... params) |
void |
offline() |
void |
online() |
boolean |
removeKey(Comparable<?> rawkey)
remove a key from the ring.
|
void |
replyMsgReceived(ReplyMessage sgReplyMessage) |
void |
requestMsgReceived(RequestMessage sgMessage)
one-way RPCs
|
void |
rtLockR() |
void |
rtLockW() |
void |
rtUnlockR() |
void |
rtUnlockW() |
ScheduledFuture<?> |
schedule(Runnable task,
long delay) |
ScheduledFuture<?> |
schedule(Runnable task,
long delay,
long period) |
void |
schedule(TimerTask task,
long delay)
非推奨です。
|
void |
schedule(TimerTask task,
long delay,
long period)
非推奨です。
|
String |
showTable()
get a the routing table in plain text format.
|
String |
toString() |
String |
toStringShort() |
changeRPCTimeout, changeTransport, checkActive, getEndpoint, getRPCObject, getSrcPeerId, getStub, getStub, getStub, getStub, getStub, getStub, getStub, getStub, getTransport, invokeInReceive, isOnline, newMethodCall, rcall, rcall, rcall, rcall, rcall, rcall, rcall, rcall, receiveOneway, receiveSync, registerRPCObject, sendInvoke, sendOnewayInvoke, unregisterRPCObjectprotected static final org.slf4j.Logger logger
public static TransportId DEFAULT_TRANSPORT_ID
public final TransportId transId
protected static final KeyComparator keyComp
protected NodeManager manager
protected final PeerId peerId
protected NavigableMap<Comparable<?>,RingVNode<E extends Endpoint>> keyHash
protected Random rand
protected final MessagingFramework msgframe
protected final StatManager statman
public static int DDLL_CHECK_PERIOD_L0
public static int RPC_TIMEOUT
public RingManager(TransportId transId, ChannelTransport<E> trans) throws IdConflictException, IOException
transId - transportIdtrans - underlying transportIdConflictException - the exception for id confliction.IOException - the exeption for I/O error.public void online()
online クラス内 RPCInvoker<RingIf,E extends Endpoint>public void offline()
offline クラス内 RPCInvoker<RingIf,E extends Endpoint>public void fin()
fin クラス内 RPCInvoker<RingIf,E extends Endpoint>public boolean isActive()
public void rtLockR()
public void rtUnlockR()
public void rtLockW()
public void rtUnlockW()
public Condition newCondition()
public void checkLocked()
public RingIf getStub(E addr, int rpcTimeout)
RPCInvokergetStub クラス内 RPCInvoker<RingIf,E extends Endpoint>addr - リモートピアを示すEndpointrpcTimeout - timeout値(msec)public RingIf getStub(Endpoint dst)
RPCInvokergetStub クラス内 RPCInvoker<RingIf,E extends Endpoint>dst - リモートピアを示すEndpoint@Deprecated public void schedule(TimerTask task, long delay)
public ScheduledFuture<?> schedule(Runnable task, long delay)
@Deprecated public void schedule(TimerTask task, long delay, long period)
public ScheduledFuture<?> schedule(Runnable task, long delay, long period)
public PeerId getPeerId()
public Collection<? extends RingVNode<E>> allVNodes()
public List<? extends RingVNode<E>> allValidVNodes()
public RingVNode<E> getVNode(Comparable<?> rawkey)
rawkey - the raw key.public String toStringShort()
protected RingVNode<E> newVNode(Comparable<?> rawkey, Object... params)
rawkey - the rawkeyparams - parameters.public String showTable()
protected NavigableMap<DdllKey,Link> getAvailableLinks()
public Link[] getLocalLinks()
getLocalLinks インタフェース内 RingIfprotected boolean addKey(Comparable<?> rawkey) throws IOException, UnavailableException
rawkey - the keyIOException - thrown when some I/O error occurred in communicating with the
introducerUnavailableException - thrown when the introducer has no keypublic boolean addKey(E introducer, Comparable<?> rawkey) throws UnavailableException, IOException
同一キーは複数登録できない. 1物理ノード上に複数キーを並行挿入できるようにすることが 困難だったので,synchronized method としている.
introducer - some node that has been inserted to the skip graphrawkey - the keyIOException - thrown when some I/O error occurred in communicating with the
introducerUnavailableException - thrown when the introducer has no keyprotected boolean addKey(E introducer, Comparable<?> rawkey, Object... vnodeParams) throws UnavailableException, IOException
public boolean removeKey(Comparable<?> rawkey) throws IOException
rawkey - the keyIOException - thrown if some I/O error occurred.public Node.InsertPoint find(E introducer, DdllKey key, boolean accurate, Object query, TransOptions opts) throws UnavailableException, IOException
introducer - the node to communicate with.key - the query keyaccurate - true if accurate location is required (do not trust left links
of DDLL node)query - non-null if NO_RESPONSEopts - the transport options.UnavailableException - 自ノードあるいはseedにkeyが登録されていないIOException - communication errorpublic Node.InsertPoint findImmedNeighbors(E introducer, DdllKey key, Object query, TransOptions opts) throws UnavailableException, IOException
introducer - an introducer nodekey - a DDLL key to be searchedquery - the query object.opts - the transport options.IOException - the exception thrown when an I/O error occurred.UnavailableException - the exception thrown when the insert point is unavailable.public Link[] getClosestLinks(DdllKey key) throws UnavailableException
getClosestLinks インタフェース内 RingIfkey - the keyUnavailableException - thrown if no key is available at the local routing tablepublic Link findLeftLink(DdllKey key) throws UnavailableException
key - the keyUnavailableException - thrown if no key is available at the local routing tablepublic void fixRoutingTables(Collection<Link> failedNodes, RQMessage parentMsg, Collection<CircularRange<DdllKey>> ranges)
public RequestMessage getRequestMessageById(int replyId)
public void requestMsgReceived(RequestMessage sgMessage)
requestMsgReceived インタフェース内 RingIfpublic void replyMsgReceived(ReplyMessage sgReplyMessage)
replyMsgReceived インタフェース内 RingIfpublic void ackReceived(int msgId,
AckMessage ackMessage)
ackReceived インタフェース内 RingIfCopyright © 2017. All rights reserved.