Class ZookeeperLastPrimaryHandler
java.lang.Object
com.gigaspaces.internal.server.space.ZookeeperLastPrimaryHandler
Created by tamirs
on 5/9/17.
-
Constructor Summary
ConstructorsConstructorDescriptionZookeeperLastPrimaryHandler(SpaceImpl spaceImpl, AttributeStore attributeStore, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbooleanbooleanbooleanvoidvoidvoidbooleansetMeAsLastPrimaryIfUnchanged(String expectedLastPrimary) PIC-6571: Sets this instance as last primary only if the current record still equalsexpectedLastPrimary(as read when leadership was offered).voidstatic Stringstatic Stringstatic StringtoUnHealthyPath(String spaceName, String partitionId)
-
Constructor Details
-
ZookeeperLastPrimaryHandler
public ZookeeperLastPrimaryHandler(SpaceImpl spaceImpl, AttributeStore attributeStore, org.slf4j.Logger logger)
-
-
Method Details
-
toUnHealthyPath
-
removeLastPrimaryRecord
- Throws:
IOException
-
removeUnhealthyRecord
- Throws:
IOException
-
setMeAsLastPrimary
- Throws:
IOException
-
setMeAsLastPrimaryIfUnchanged
PIC-6571: Sets this instance as last primary only if the current record still equalsexpectedLastPrimary(as read when leadership was offered). Prevents a stale promotion from overriding a newer primary's record.- Returns:
- true if this instance is (now) the last primary, false if another instance has written the record meanwhile
- Throws:
IOException
-
getMyLastPrimaryValue
-
isMe
- Returns:
- true if the given last primary record value denotes this exact instance (instance id AND space uuid).
-
setMeAsUnHealthy
- Throws:
IOException
-
isLastPrimary
public boolean isLastPrimary() -
isUnhealthy
public boolean isUnhealthy() -
getLastPrimaryName
- Throws:
IOException
-
getUnhealthyName
- Throws:
IOException
-
getLastPrimaryNameMemoryXtend
- Throws:
IOException
-
getAttributeStoreKey
-
getSeparator
-
toPath
-
toId
-