Package com.biglybt.core.dht.db
Interface DHTDB
- All Known Implementing Classes:
DHTDBImpl
public interface DHTDB
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
get
(DHTTransportContact reader, HashWrapper key, int max_values, short flags, boolean external_request) get
(HashWrapper key) Internal lookup for locally originated valuesgetAllValues
(HashWrapper key) getAnyValue
(HashWrapper key) Returns a value for the given key (local or remote) if foundgetKeyBlockDetails
(byte[] key) getKeys()
Returns an iterator over HashWrapper values denoting the snapshot of keys Thus by the time a key is used the entry may no longer existgetStats()
boolean
hasKey
(HashWrapper key) boolean
isEmpty()
boolean
isKeyBlocked
(byte[] key) keyBlockRequest
(DHTTransportContact direct_sender, byte[] request, byte[] signature) void
print
(boolean full) queryStore
(DHTTransportContact originating_contact, int header_len, List<Object[]> keys) remove
(DHTTransportContact sender, HashWrapper key) Local remove - returns a value suitable for putting in the DHTremove
(DHTTransportContact sender, HashWrapper key, short flags) void
setControl
(DHTControl control) void
setSleeping
(boolean asleep) void
setSuspended
(boolean susp) byte
store
(DHTTransportContact sender, HashWrapper key, DHTTransportValue[] values) Remote storestore
(HashWrapper key, byte[] value, short flags, byte life_hours, byte replication_control) Local store
-
Method Details
-
setControl
-
store
DHTDBValue store(HashWrapper key, byte[] value, short flags, byte life_hours, byte replication_control) Local store- Parameters:
key
-value
-flags
-- Returns:
-
store
Remote store- Parameters:
sender
-key
-values
-- Returns:
- diversification state
-
queryStore
DHTTransportQueryStoreReply queryStore(DHTTransportContact originating_contact, int header_len, List<Object[]> keys) -
get
Internal lookup for locally originated values- Parameters:
key
-- Returns:
-
getAnyValue
Returns a value for the given key (local or remote) if found- Parameters:
key
-- Returns:
-
getAllValues
-
hasKey
-
get
DHTDBLookupResult get(DHTTransportContact reader, HashWrapper key, int max_values, short flags, boolean external_request) -
remove
Local remove - returns a value suitable for putting in the DHT- Parameters:
sender
-key
-- Returns:
-
remove
-
keyBlockRequest
DHTStorageBlock keyBlockRequest(DHTTransportContact direct_sender, byte[] request, byte[] signature) -
getKeyBlockDetails
-
isKeyBlocked
boolean isKeyBlocked(byte[] key) -
getDirectKeyBlocks
DHTStorageBlock[] getDirectKeyBlocks() -
isEmpty
boolean isEmpty() -
getKeys
Iterator<HashWrapper> getKeys()Returns an iterator over HashWrapper values denoting the snapshot of keys Thus by the time a key is used the entry may no longer exist- Returns:
-
getStats
DHTDBStats getStats() -
setSleeping
void setSleeping(boolean asleep) -
setSuspended
void setSuspended(boolean susp) -
destroy
void destroy() -
print
void print(boolean full)
-