public class HazelCastClusterFileStateCache extends ClusterFileStateCache implements ClusterInterface, com.hazelcast.core.MembershipListener, com.hazelcast.core.EntryListener, com.hazelcast.core.MessageListener
| Modifier and Type | Field and Description |
|---|---|
static int |
DebugByteLock |
static int |
DebugCleanup |
static int |
DebugClusterEntry |
static int |
DebugClusterMessage |
static int |
DebugExpire |
static int |
DebugFileAccess |
static int |
DebugFileDataUpdate |
static int |
DebugFileStatus |
static int |
DebugMembership |
static int |
DebugNearCache |
static int |
DebugOplock |
static int |
DebugPerNode |
static int |
DebugRemoteTask |
static int |
DebugRemoteTiming |
static int |
DebugRename |
static int |
DebugStateCache |
static long |
DefaultNearCacheTimeout |
static long |
MaximumNearCacheTimeout |
static long |
MinimumNearCacheTimeout |
DefaultExpireCheckInterval, DefaultFileStateExpireInterval, MinimumExpireCheckInterval, MinimumFileStateExpireInterval| Constructor and Description |
|---|
HazelCastClusterFileStateCache()
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLock(FileState fstate,
FileLock lock)
Add a lock to this file
|
boolean |
addOpLock(FileState fstate,
OpLockDetails oplock,
NetworkFile netFile)
Add an oplock
|
boolean |
canReadFile(ClusterFileState clState,
long offset,
long len,
int pid)
Check if the file is readable for the specified section of the file and process id
|
boolean |
canWriteFile(ClusterFileState clState,
long offset,
long len,
int pid)
Check if the file is writeable for the specified section of the file and process id
|
void |
changeOpLockType(OpLockDetails oplock,
int newTyp)
Change an oplock type
|
protected boolean |
checkFileAccess(ClusterFileState clState,
long offset,
long len,
int pid,
boolean writeCheck)
Check file access using a remote call
|
protected void |
clearLowPriorityStateUpdates(int updateMask)
Clear some, or all, low priority state updates that may be queued
|
void |
clearOpLock(FileState fstate)
Clear an oplock
|
FileLock |
createFileLockObject(NetworkFile file,
long offset,
long len,
int pid)
Create a file lock object
|
void |
dumpCache(boolean dumpAttribs)
Dump the state cache entries to the debug device
|
void |
entryAdded(com.hazelcast.core.EntryEvent event)
Invoked when an entry is added to the clustered cache
|
void |
entryEvicted(com.hazelcast.core.EntryEvent event)
Invoked when an entry is evicted from the clustered cache
|
void |
entryRemoved(com.hazelcast.core.EntryEvent event)
Invoked when an entry is removed from the clustered cache
|
void |
entryUpdated(com.hazelcast.core.EntryEvent event)
Invoked when an entry is updated in the clustered cache
|
java.util.Enumeration |
enumerateCache()
Enumerate the file state cache
|
FileState |
findFileState(java.lang.String path)
Find the file state for the specified path
|
FileState |
findFileState(java.lang.String path,
boolean create)
Find the file state for the specified path, and optionally create a new file state if not
found
|
FileState |
findFileState(java.lang.String path,
boolean create,
int status)
Find the file state for the specified path, and optionally create a new file state if not
found with the specified initial status
|
java.lang.String |
getClusterName()
Return the cluster name
|
FileStateProxy |
getFileStateProxy(FileState fstate)
Return a file state proxy for the specified file state
|
ClusterNode |
getLocalNode()
Return the local node details
|
ClusterNodeList |
getNodeList()
Return the list of nodes
|
NotifyChangeHandler |
getNotifyChangeHandler()
Return the change notification handler, if configured for the filesystem
|
OpLockDetails |
getOpLock(FileState fstate)
Return the oplock details for a file, or null if there is no oplock
|
OpLockManager |
getOpLockManager()
Return the oplock manager
|
PerNodeState |
getPerNodeState(ClusterFileState fState,
boolean createState)
Return the per node state for a file state, and optionally create a new per node state
|
PerNodeState |
getPerNodeState(java.lang.String path,
boolean createState)
Return the per node state for a file path, and optionally create a new per node state
|
ClusterFileStateCache |
getStateCache()
Return the associated cluster state cache
|
protected HazelCastClusterFileState |
getStateFromNearCache(java.lang.String path)
Try and get a file state from the near cache
|
ThreadRequestPool |
getThreadPool()
Return the thread pool
|
FileAccessToken |
grantFileAccess(FileOpenParams params,
FileState fstate,
int fileSts)
Grant the required file access
|
boolean |
hasActiveLocks(FileState fstate)
Check if there are active locks on this file
|
boolean |
hasDebugLevel(int flg)
Check if the specified debug level is enabled
|
boolean |
hasNearCache()
Check if the near-cache is enabled
|
boolean |
hasNotifyChangeHandler()
Check if the change notification handler is set
|
boolean |
hasSendNotExistStates()
Check if none existent file/folder states should be sent to the cluster
|
boolean |
hasTaskDebug()
Check if remote task debugging is enabled
|
boolean |
hasTaskTiming()
Check if remote task timing is enabled
|
void |
initializeCache(org.springframework.extensions.config.ConfigElement config,
ServerConfiguration srvConfig)
Initialize the file state cache
|
protected boolean |
isLocalKey(java.lang.String path)
Check if the path is in the locally owned cache partition
|
void |
memberAdded(com.hazelcast.core.MembershipEvent membershipEvent)
Cluster member added
|
void |
memberRemoved(com.hazelcast.core.MembershipEvent membershipEvent)
Cluster member removed
|
int |
numberOfStates()
Return the number of states in the cache
|
void |
onMessage(ClusterMessage msg)
Cluster topic message listener
|
protected void |
procDataUpdate(DataUpdateMessage msg)
Process a remote file data update message
|
protected void |
procFileStateRename(StateRenameMessage msg)
Process a remote file state rename message
|
protected void |
procFileStateUpdate(StateUpdateMessage msg)
Process a remote file state update message
|
protected void |
procOpLockBreakNotify(OpLockMessage msg)
Process a remote oplock break notify message
|
protected void |
procOpLockBreakRequest(OpLockMessage msg)
Process a remote oplock break request message
|
protected void |
procOpLockTypeChange(OpLockMessage msg)
Process a remote oplock type change message
|
int |
releaseFileAccess(FileState fstate,
FileAccessToken token)
Release access to a file
|
protected boolean |
remoteUpdateState(ClusterFileState clState,
int updateMask)
Update a file state using a remote task call
|
void |
removeAllFileStates()
Remove all file states from the cache
|
int |
removeExpiredFileStates()
Remove expired file states from the cache
As the cache data is spread across the cluster we only expire file states that are stored on
the local node.
|
FileState |
removeFileState(java.lang.String path)
Remove the file state for the specified path
|
void |
removeLock(FileState fstate,
FileLock lock)
Remove a lock on this file
|
protected int |
removeMemberData(com.hazelcast.core.Member member)
Remove cluster cache data that is owned by the specified cluster member as the member has left
the cluster (such as file locks and oplocks).
|
void |
renameFileState(java.lang.String newPath,
FileState state,
boolean isDir)
Rename a file state, remove the existing entry, update the path and add the state back into
the cache using the new path.
|
void |
requestOplockBreak(java.lang.String path,
OpLockDetails oplock,
SMBSrvSession sess,
SMBSrvPacket pkt)
Request an oplock break
|
void |
setDataUpdateCompleted(FileState fstate)
Indicate that a data update has completed for the specified file
|
void |
setDataUpdateInProgress(FileState fstate)
Indicate a data update is in progress for the specified file
|
void |
setLocalNode(ClusterNode localNode)
Set the local cluster node
|
void |
setNodeList(ClusterNodeList nodeList)
Set the cluster node list
|
void |
setNotifyChangeHandler(NotifyChangeHandler notifyHandler)
Set the change notification handler
|
void |
setOpLockManager(OpLockManager oplockMgr)
Set the oplock manager
|
void |
setSendNotExistStates(boolean notExist)
Set the send none existent file/folder states to the cluster
|
void |
shutdownCluster()
Shutdown the cluster
|
void |
startCluster()
Start the cluster
|
void |
updateFileState(ClusterFileState clState,
int updateMask)
Update a file state, notify the cluster of the updates
|
protected void |
updateNearCacheState(ClusterFileState clState)
Update a near-cache state with a new state received from a remote task call
|
addNodeToPurgeList, clusterRunning, getCluster, isClusteredCache, setCluster, setDriverDetails, stateCacheShuttingDown, stateCacheStartedaddStateCacheListener, addStateListener, getCheckInterval, getFileStateExpireInterval, getStateCacheListener, getStateListener, hasDebug, hasDebugExpiredStates, hasDumpOnShutdown, hasStateCacheListener, hasStateListener, isCaseSensitive, removeStateCacheListener, removeStateListener, setCaseSensitive, setCheckInterval, setDebug, setDebugExpiredStates, setDumpOnShutdown, setFileStateExpireIntervalclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasDebugpublic static final int DebugStateCache
public static final int DebugExpire
public static final int DebugNearCache
public static final int DebugOplock
public static final int DebugByteLock
public static final int DebugFileAccess
public static final int DebugMembership
public static final int DebugCleanup
public static final int DebugPerNode
public static final int DebugClusterEntry
public static final int DebugClusterMessage
public static final int DebugRemoteTask
public static final int DebugRemoteTiming
public static final int DebugRename
public static final int DebugFileDataUpdate
public static final int DebugFileStatus
public static final long DefaultNearCacheTimeout
public static final long MinimumNearCacheTimeout
public static final long MaximumNearCacheTimeout
public HazelCastClusterFileStateCache()
public void initializeCache(org.springframework.extensions.config.ConfigElement config,
ServerConfiguration srvConfig)
throws InvalidConfigurationException
initializeCache in class FileStateCachesrvConfig - ServerConfigurationconfig - ConfigElementInvalidConfigurationExceptionpublic int numberOfStates()
numberOfStates in class FileStateCachepublic java.util.Enumeration enumerateCache()
public void dumpCache(boolean dumpAttribs)
dumpCache in class FileStateCachedumpAttribs - booleanpublic FileStateProxy getFileStateProxy(FileState fstate)
getFileStateProxy in class FileStateCachefstate - FileStatepublic final boolean hasNearCache()
public FileState findFileState(java.lang.String path)
findFileState in class FileStateCachepath - Stringpublic FileState findFileState(java.lang.String path, boolean create)
findFileState in class FileStateCachepath - Stringcreate - booleanpublic FileState findFileState(java.lang.String path, boolean create, int status)
findFileState in class FileStateCachepath - Stringcreate - booleanstatus - intpublic FileState removeFileState(java.lang.String path)
removeFileState in class FileStateCachepath - Stringpublic void renameFileState(java.lang.String newPath,
FileState state,
boolean isDir)
renameFileState in class FileStateCachenewPath - Stringstate - FileStateisDir - booleanpublic void removeAllFileStates()
removeAllFileStates in class FileStateCachepublic int removeExpiredFileStates()
removeExpiredFileStates in class FileStateCachepublic OpLockDetails getOpLock(FileState fstate)
getOpLock in class FileStateCachefstate - FileStatepublic boolean addOpLock(FileState fstate, OpLockDetails oplock, NetworkFile netFile) throws ExistingOpLockException
addOpLock in class FileStateCachefstate - FileStateoplock - OpLockDetailsnetFile - NetworkFileExistingOpLockExceptionpublic void clearOpLock(FileState fstate)
clearOpLock in class FileStateCachefstate - FileStatepublic FileLock createFileLockObject(NetworkFile file, long offset, long len, int pid)
createFileLockObject in class FileStateCachefile - NetworkFileoffset - longlen - longpid - intpublic boolean hasActiveLocks(FileState fstate)
hasActiveLocks in class FileStateCachefstate - FileStatepublic void addLock(FileState fstate, FileLock lock) throws LockConflictException
addLock in class FileStateCachefstate - FileStatelock - FileLockLockConflictExceptionpublic void removeLock(FileState fstate, FileLock lock) throws NotLockedException
removeLock in class FileStateCachefstate - FileStatelock - FileLockNotLockedExceptionpublic void startCluster()
throws java.lang.Exception
startCluster in interface ClusterInterfacejava.lang.Exceptionpublic void shutdownCluster()
throws java.lang.Exception
shutdownCluster in interface ClusterInterfacejava.lang.Exceptionpublic void requestOplockBreak(java.lang.String path,
OpLockDetails oplock,
SMBSrvSession sess,
SMBSrvPacket pkt)
throws java.io.IOException,
DeferFailedException
requestOplockBreak in class FileStateCacheclNode - ClusterNodeclState - ClusterFileStatesess - SMBSrvSessionpkt - SMBSrvPacketjava.io.IOExceptionDeferFailedExceptionpublic void changeOpLockType(OpLockDetails oplock, int newTyp)
changeOpLockType in class FileStateCacheoplock - OpLockDetailsnewTyp - public void memberAdded(com.hazelcast.core.MembershipEvent membershipEvent)
memberAdded in interface com.hazelcast.core.MembershipListenermembershipEvent - MembershipEventpublic void memberRemoved(com.hazelcast.core.MembershipEvent membershipEvent)
memberRemoved in interface com.hazelcast.core.MembershipListenermembershipEvent - MembershipEventprotected int removeMemberData(com.hazelcast.core.Member member)
member - Memberpublic PerNodeState getPerNodeState(ClusterFileState fState, boolean createState)
getPerNodeState in class ClusterFileStateCachefState - ClusterFileStatecreateState - booleanpublic PerNodeState getPerNodeState(java.lang.String path, boolean createState)
getPerNodeState in class ClusterFileStateCachepath - StringcreateState - booleanpublic FileAccessToken grantFileAccess(FileOpenParams params, FileState fstate, int fileSts) throws FileSharingException, AccessDeniedException, FileExistsException
grantFileAccess in class FileStateCacheparams - FileOpenParamsfstate - FileStatefileSts - intFileSharingExceptionAccessDeniedExceptionFileExistsExceptionpublic int releaseFileAccess(FileState fstate, FileAccessToken token)
releaseFileAccess in class FileStateCachetoken - FileAccessTokenpublic boolean canReadFile(ClusterFileState clState, long offset, long len, int pid)
canReadFile in class ClusterFileStateCacheclState - ClusterFileStateoffset - longlen - longpid - intpublic boolean canWriteFile(ClusterFileState clState, long offset, long len, int pid)
canWriteFile in class ClusterFileStateCacheclState - ClusterFileStateoffset - longlen - longpid - intprotected boolean checkFileAccess(ClusterFileState clState, long offset, long len, int pid, boolean writeCheck)
clState - ClusterFileStateoffset - longlen - longpid - intwriteCheck - booleanprotected boolean remoteUpdateState(ClusterFileState clState, int updateMask)
clState - ClusterFileStateupdateMask - intpublic void updateFileState(ClusterFileState clState, int updateMask)
updateFileState in class ClusterFileStateCacheclState - ClusterFileStateupdateMask - intpublic java.lang.String getClusterName()
getClusterName in interface ClusterInterfacepublic ClusterNodeList getNodeList()
getNodeList in interface ClusterInterfacepublic ClusterNode getLocalNode()
getLocalNode in interface ClusterInterfacepublic ClusterFileStateCache getStateCache()
getStateCache in interface ClusterInterfacepublic ThreadRequestPool getThreadPool()
getThreadPool in interface ClusterInterfacepublic boolean hasSendNotExistStates()
hasSendNotExistStates in interface ClusterInterfacepublic OpLockManager getOpLockManager()
getOpLockManager in interface ClusterInterfacepublic boolean hasNotifyChangeHandler()
public NotifyChangeHandler getNotifyChangeHandler()
getNotifyChangeHandler in interface ClusterInterfacepublic void setSendNotExistStates(boolean notExist)
setSendNotExistStates in interface ClusterInterfacenotExist - booleanpublic void setOpLockManager(OpLockManager oplockMgr)
setOpLockManager in interface ClusterInterfaceoplockMgr - OpLockManagerpublic void setNotifyChangeHandler(NotifyChangeHandler notifyHandler)
setNotifyChangeHandler in interface ClusterInterfacenotifyHandler - NotifyChangeHandlerpublic void setNodeList(ClusterNodeList nodeList)
setNodeList in interface ClusterInterfacenodeList - ClusterNodeListpublic void setLocalNode(ClusterNode localNode)
setLocalNode in interface ClusterInterfacelocalNode - ClusterNodepublic final boolean hasDebugLevel(int flg)
flg - intpublic final boolean hasTaskDebug()
public final boolean hasTaskTiming()
public void entryAdded(com.hazelcast.core.EntryEvent event)
entryAdded in interface com.hazelcast.core.EntryListenerevent - entry eventpublic void entryRemoved(com.hazelcast.core.EntryEvent event)
entryRemoved in interface com.hazelcast.core.EntryListenerevent - entry eventpublic void entryUpdated(com.hazelcast.core.EntryEvent event)
entryUpdated in interface com.hazelcast.core.EntryListenerevent - entry eventpublic void entryEvicted(com.hazelcast.core.EntryEvent event)
entryEvicted in interface com.hazelcast.core.EntryListenerevent - entry eventpublic void onMessage(ClusterMessage msg)
onMessage in interface com.hazelcast.core.MessageListenermsg - ClusterMessageprotected void procOpLockBreakRequest(OpLockMessage msg)
msg - OpLockMessageprotected void procOpLockBreakNotify(OpLockMessage msg)
msg - OpLockMessageprotected void procOpLockTypeChange(OpLockMessage msg)
msg - OpLockMessageprotected void procFileStateUpdate(StateUpdateMessage msg)
msg - StateUpdateMessageprotected void procFileStateRename(StateRenameMessage msg)
msg - StateRenameMessageprotected void procDataUpdate(DataUpdateMessage msg)
msg - DataUpdateMessageprotected boolean isLocalKey(java.lang.String path)
path - Stringprotected final void clearLowPriorityStateUpdates(int updateMask)
updateMask - intprotected final void updateNearCacheState(ClusterFileState clState)
clState - ClusterFileStatepublic void setDataUpdateInProgress(FileState fstate)
setDataUpdateInProgress in class FileStateCachefstate - FileStatepublic void setDataUpdateCompleted(FileState fstate)
setDataUpdateCompleted in class FileStateCachefstate - FileStateprotected final HazelCastClusterFileState getStateFromNearCache(java.lang.String path)
path - StringCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.