public class SparseDistributedVectorStorage extends CacheUtils implements VectorStorage, StorageConstants, DistributedStorage<RowColMatrixKey>
VectorStorage implementation for SparseDistributedVector.CacheUtils.CacheEntry<K,V>COLUMN_STORAGE_MODE, RANDOM_ACCESS_MODE, ROW_STORAGE_MODE, SEQUENTIAL_ACCESS_MODE, UNKNOWN_STORAGE_MODE| Constructor and Description |
|---|
SparseDistributedVectorStorage() |
SparseDistributedVectorStorage(int size,
int acsMode) |
| Modifier and Type | Method and Description |
|---|---|
int |
accessMode()
Gets access mode
|
IgniteCache<RowColMatrixKey,Double> |
cache()
Gets cache
|
String |
cacheName() |
double[] |
data()
Gets underlying array if
StorageOpsMetrics.isArrayBased() returns true. |
void |
destroy()
Delete all data from cache.
|
boolean |
equals(Object obj) |
double |
get(int i)
Gets vector element by element index
|
Set<RowColMatrixKey> |
getAllKeys()
Build a keyset for this storage.
|
RowColMatrixKey |
getCacheKey(int idx)
Builds cache key for vector element.
|
UUID |
getUUID() |
int |
hashCode() |
boolean |
isArrayBased()
Checks if implementation is based on Java arrays.
|
boolean |
isDense()
Checks if this implementation should be considered dense so that it explicitly
represents every value.
|
boolean |
isDistributed()
Checks whether implementation is JVM-local or distributed (multi-JVM).
|
boolean |
isRandomAccess()
Checks if this implementation is optimized for random access.
|
boolean |
isSequentialAccess()
Checks if this implementation should be considered to be iterable in index order in an efficient way.
|
void |
readExternal(ObjectInput in) |
void |
set(int i,
double v)
Sets vector element by index
|
int |
size() |
void |
writeExternal(ObjectOutput out) |
bcast, bcast, bcast, bcast, distributedFold, fold, fold, foreach, getClusterGroupForGivenKey, ignite, map, max, min, reduce, reduce, sparseMap, sparseMapForVector, sparseMax, sparseMin, sparseSum, sum, update, updateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitassertAccessMode, assertStorageModepublic SparseDistributedVectorStorage()
public SparseDistributedVectorStorage(int size,
int acsMode)
size - Amount of elements in the vector.acsMode - Random or sequential access mode.public IgniteCache<RowColMatrixKey,Double> cache()
public int accessMode()
public double get(int i)
get in interface VectorStoragei - Vector element index.public void set(int i,
double v)
set in interface VectorStoragei - Vector element index.v - Value to set at given index.public int size()
size in interface VectorStoragepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic boolean isSequentialAccess()
isSequentialAccess in interface StorageOpsMetricspublic boolean isDense()
isDense in interface StorageOpsMetricspublic boolean isRandomAccess()
isRandomAccess in interface StorageOpsMetricspublic boolean isDistributed()
isDistributed in interface StorageOpsMetricspublic boolean isArrayBased()
isArrayBased in interface StorageOpsMetricspublic void destroy()
destroy in interface Destroyablepublic RowColMatrixKey getCacheKey(int idx)
idx - Index.public Set<RowColMatrixKey> getAllKeys()
getAllKeys in interface DistributedStorage<RowColMatrixKey>public String cacheName()
cacheName in interface DistributedStorage<RowColMatrixKey>public UUID getUUID()
public double[] data()
StorageOpsMetrics.isArrayBased() returns true.
Returns null if in other cases.data in interface VectorStorageStorageOpsMetrics.isArrayBased()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018