Class ClusterMembership
Object
ClusterMembership
A mapping of files to membership of particular clusters.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionClusterMembership
(ClusterIdentifier clusterIdentifierIfAbsent) Creates a newClusterMembership
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
associateFileWithCluster
(File file, long timestamp, ClusterIdentifier clusterIdentifier) Indicates a particular file is a member of a particular cluster.clusterFor
(File file) Finds the corresponding cluster for a particular file.
-
Constructor Details
-
ClusterMembership
Creates a newClusterMembership
instance.- Parameters:
clusterIdentifierIfAbsent
- The cluster-identifier that is returned for get operations where no file-mapping exists in the map.This can be convenient to describe outliers that have not been placed in any cluster.
-
-
Method Details
-
associateFileWithCluster
public void associateFileWithCluster(File file, long timestamp, ClusterIdentifier clusterIdentifier) throws OperationFailedException Indicates a particular file is a member of a particular cluster.- Parameters:
file
- the file.timestamp
- the timetamp (seconds since the epoch).clusterIdentifier
- an identifier for the cluster.- Throws:
OperationFailedException
- if the file is already associated with a cluster.
-
clusterFor
Finds the corresponding cluster for a particular file.- Parameters:
file
- the file to find a cluster for.- Returns:
- the identifier for the cluster from the map, or
clusterIdentifierIfAbsent
(as per constructor) if the file is not mapped.
-