パッケージ org.piax.gtrans.ov.ring
クラス RingManager<E extends Endpoint>
- 型パラメータ:
E- the type of Endpoint in the underlying network.
- 直系の既知のサブクラス:
RQManager
public class RingManager<E extends Endpoint> extends RPCInvoker<RingIf,E> implements RingIf
simple ring network over DDLL protocol.
this class may be used as a base class of ring-based structured P2P
networks. this class can handle multiple keys.
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ クラス 説明 static classRingManager.ExecQueryReturnan execQuery return value used by (non-scalable) range queriesstatic classRingManager.LinkContainerA class used for passing a link to the closest node.static classRingManager.RightNodeMismatch -
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 static intDDLL_CHECK_PERIOD_L0DDLL's left node check period for level 0 (msec)static TransportIdDEFAULT_TRANSPORT_IDprotected static KeyComparatorkeyCompprotected NavigableMap<Comparable<?>,RingVNode<E>>keyHashprotected static org.slf4j.Loggerloggerprotected NodeManagermanagerDDLL node managerprotected MessagingFrameworkmsgframeprotected EmyLocatorprotected PeerIdpeerIdprotected Randomrandstatic intRPC_TIMEOUTprotected StatManagerstatmanTransportIdtransIdクラスから継承されたフィールド org.piax.gtrans.RPCInvoker
channelPool, isActive, objId, POOL_CHANNEL, POOL_CHANNEL_SIZE, trans, USE_CHANNEL_FOR_ONEWAY -
コンストラクタの概要
コンストラクタ コンストラクタ 説明 RingManager(TransportId transId, ChannelTransport<E> trans)create a Chord# instance. -
メソッドの概要
修飾子とタイプ メソッド 説明 voidackReceived(int msgId, AckMessage ackMessage)booleanaddKey(E introducer, Comparable<?> rawkey)add a key to the ring.protected booleanaddKey(E introducer, Comparable<?> rawkey, Object... vnodeParams)protected booleanaddKey(Comparable<?> rawkey)add a key to the ring.List<? extends RingVNode<E>>allValidVNodes()get all inserted RingVNode instancesCollection<? extends RingVNode<E>>allVNodes()get all RingVNode instancesvoidcheckLocked()voidfin()Node.InsertPointfind(E introducer, DdllKey key, boolean accurate, Object query, TransOptions opts)find a location to insert `key'.Node.InsertPointfindImmedNeighbors(E introducer, DdllKey key, Object query, TransOptions opts)Find the contact nodes (the immediate left and right node) for inserting a node.LinkfindLeftLink(DdllKey key)find the closest left link of `key' from the local routing table.voidfixRoutingTables(Collection<Link> failedNodes, RQMessage parentMsg, Collection<Range<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()PeerIdgetPeerId()get PeerIdRequestMessagegetRequestMessageById(int replyId)RingIfgetStub(E addr, int rpcTimeout)リモートピア上のこのオブジェクトに対応するRPCInvokerオブジェクトのメソッドを呼び出すためのstubを返す。RingIfgetStub(Endpoint dst)リモートピア上のこのオブジェクトに対応するRPCInvokerオブジェクトのメソッドを 呼び出すためのstubを返す。RingVNode<E>getVNode(Comparable<?> rawkey)get RingVNode instance (for debugging only)booleanisActive()ConditionnewCondition()protected RingVNode<E>newVNode(Comparable<?> rawkey, Object... params)voidoffline()voidonline()booleanremoveKey(Comparable<?> rawkey)remove a key from the ring.voidreplyMsgReceived(ReplyMessage sgReplyMessage)voidrequestMsgReceived(RequestMessage sgMessage)one-way RPCsvoidrtLockR()voidrtLockW()voidrtUnlockR()voidrtUnlockW()ScheduledFuture<?>schedule(Runnable task, long delay)ScheduledFuture<?>schedule(Runnable task, long delay, long period)voidschedule(TimerTask task, long delay)推奨されていません。voidschedule(TimerTask task, long delay, long period)推奨されていません。StringshowTable()get a the routing table in plain text format.StringtoString()StringtoStringShort()クラスから継承されたメソッド org.piax.gtrans.RPCInvoker
changeRPCTimeout, changeTransport, checkActive, createObjId, 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, unregisterRPCObject
-
フィールド詳細
-
logger
protected static final org.slf4j.Logger logger -
DEFAULT_TRANSPORT_ID
-
transId
-
keyComp
-
manager
DDLL node manager -
myLocator
-
peerId
-
keyHash
-
rand
-
msgframe
-
statman
-
DDLL_CHECK_PERIOD_L0
public static int DDLL_CHECK_PERIOD_L0DDLL's left node check period for level 0 (msec) -
RPC_TIMEOUT
public static int RPC_TIMEOUT
-
-
コンストラクタの詳細
-
RingManager
public RingManager(TransportId transId, ChannelTransport<E> trans) throws IdConflictException, IOExceptioncreate a Chord# instance.- パラメータ:
transId- transportIdtrans- underlying transport- 例外:
IdConflictException- the exception for id confliction.IOException- the exeption for I/O error.
-
-
メソッドの詳細
-
online
public void online()- オーバーライド:
onlineクラス内RPCInvoker<RingIf,E extends Endpoint>
-
offline
public void offline()- オーバーライド:
offlineクラス内RPCInvoker<RingIf,E extends Endpoint>
-
fin
public void fin()- オーバーライド:
finクラス内RPCInvoker<RingIf,E extends Endpoint>
-
isActive
public boolean isActive() -
rtLockR
public void rtLockR() -
rtUnlockR
public void rtUnlockR() -
rtLockW
public void rtLockW() -
rtUnlockW
public void rtUnlockW() -
newCondition
-
checkLocked
public void checkLocked() -
getStub
クラスからコピーされた説明:RPCInvokerリモートピア上のこのオブジェクトに対応するRPCInvokerオブジェクトのメソッドを呼び出すためのstubを返す。- オーバーライド:
getStubクラス内RPCInvoker<RingIf,E extends Endpoint>- パラメータ:
addr- リモートピアを示すEndpointrpcTimeout- timeout値(msec)- 戻り値:
- RPCのためのstub
-
getStub
クラスからコピーされた説明:RPCInvokerリモートピア上のこのオブジェクトに対応するRPCInvokerオブジェクトのメソッドを 呼び出すためのstubを返す。- オーバーライド:
getStubクラス内RPCInvoker<RingIf,E extends Endpoint>- パラメータ:
dst- リモートピアを示すEndpoint- 戻り値:
- RPCのためのstub
-
schedule
推奨されていません。 -
schedule
-
schedule
推奨されていません。 -
schedule
-
getPeerId
get PeerId- 戻り値:
- PeerId
-
allVNodes
get all RingVNode instances- 戻り値:
- collection of RingVNode
-
allValidVNodes
get all inserted RingVNode instances- 戻り値:
- collection of RingVNode
-
getVNode
get RingVNode instance (for debugging only)- パラメータ:
rawkey- the raw key.- 戻り値:
- RingVNode the ring node.
-
toString
-
toStringShort
-
newVNode
- パラメータ:
rawkey- the rawkeyparams- parameters.- 戻り値:
- the RingVNode object.
-
showTable
get a the routing table in plain text format.- 戻り値:
- routing table
-
getAvailableLinks
gather all links from all virtual nodes.- 戻り値:
- all links from all SGNodes.
-
getLocalLinks
- 定義:
getLocalLinksインタフェース内RingIf
-
addKey
add a key to the ring.- パラメータ:
rawkey- the key- 戻り値:
- true if the key was successfully added
- 例外:
IOException- thrown when some I/O error occurred in communicating with the introducerUnavailableException- thrown when the introducer has no key
-
addKey
add a key to the ring.同一キーは複数登録できない. 1物理ノード上に複数キーを並行挿入できるようにすることが 困難だったので,synchronized method としている.
- パラメータ:
introducer- some node that has been inserted to the skip graphrawkey- the key- 戻り値:
- true if the key was successfully added
- 例外:
IOException- thrown when some I/O error occurred in communicating with the introducerUnavailableException- thrown when the introducer has no key
-
addKey
protected boolean addKey(E introducer, Comparable<?> rawkey, Object... vnodeParams) throws UnavailableException, IOException -
removeKey
remove a key from the ring.- パラメータ:
rawkey- the key- 戻り値:
- true if the key was successfully removed
- 例外:
IOException- thrown if some I/O error occurred.
-
find
public Node.InsertPoint find(E introducer, DdllKey key, boolean accurate, Object query, TransOptions opts) throws UnavailableException, IOExceptionfind a location to insert `key'.- パラメータ:
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.- 戻り値:
- the insertion point for `key'
- 例外:
UnavailableException- 自ノードあるいはseedにkeyが登録されていないIOException- communication error
-
findImmedNeighbors
public Node.InsertPoint findImmedNeighbors(E introducer, DdllKey key, Object query, TransOptions opts) throws UnavailableException, IOExceptionFind the contact nodes (the immediate left and right node) for inserting a node.- パラメータ:
introducer- an introducer nodekey- a DDLL key to be searchedquery- the query object.opts- the transport options.- 戻り値:
- an InsertPoint. null if there's no existing node.
- 例外:
IOException- the exception thrown when an I/O error occurred.UnavailableException- the exception thrown when the insert point is unavailable.
-
getClosestLinks
get the closest left and right links of `key' in the local routing table.- 定義:
getClosestLinksインタフェース内RingIf- パラメータ:
key- the key- 戻り値:
- the immediate left and right links of `key'
- 例外:
UnavailableException- thrown if no key is available at the local routing table
-
findLeftLink
find the closest left link of `key' from the local routing table.- パラメータ:
key- the key- 戻り値:
- the immediate left link of `key'
- 例外:
UnavailableException- thrown if no key is available at the local routing table
-
fixRoutingTables
public void fixRoutingTables(Collection<Link> failedNodes, RQMessage parentMsg, Collection<Range<DdllKey>> ranges) -
getRequestMessageById
-
requestMsgReceived
one-way RPCs- 定義:
requestMsgReceivedインタフェース内RingIf
-
replyMsgReceived
- 定義:
replyMsgReceivedインタフェース内RingIf
-
ackReceived
- 定義:
ackReceivedインタフェース内RingIf
-