code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private void init() {
logger.info("metadata init().");
writeLock.lock();
try {
// Required keys
initCache(CLUSTER_KEY);
// If stores definition storage engine is not null, initialize metadata
// Add the mapping from key to the storage engine used
if(this... | java |
private void initStoreDefinitions(Version storesXmlVersion) {
if(this.storeDefinitionsStorageEngine == null) {
throw new VoldemortException("The store definitions directory is empty");
}
String allStoreDefinitions = "<stores>";
Version finalStoresXmlVersion = null;
i... | java |
private void resetStoreDefinitions(Set<String> storeNamesToDelete) {
// Clear entries in the metadata cache
for(String storeName: storeNamesToDelete) {
this.metadataCache.remove(storeName);
this.storeDefinitionsStorageEngine.delete(storeName, null);
this.storeNames.re... | java |
private synchronized void initSystemCache() {
List<StoreDefinition> value = storeMapper.readStoreList(new StringReader(SystemStoreConstants.SYSTEM_STORE_SCHEMA));
metadataCache.put(SYSTEM_STORES_KEY, new Versioned<Object>(value));
} | java |
public List<Versioned<V>> getWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) {
validateTimeout(requestWrapper.getRoutingTimeoutInMs());
for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) {
try {
long startTimeInMs = System.currentTime... | java |
public Version putWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) {
validateTimeout(requestWrapper.getRoutingTimeoutInMs());
List<Versioned<V>> versionedValues;
long startTime = System.currentTimeMillis();
String keyHexString = "";
if(logger.isDebugEnabled()) {
... | java |
public Version putVersionedWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper)
throws ObsoleteVersionException {
validateTimeout(requestWrapper.getRoutingTimeoutInMs());
for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) {
try {
... | java |
public Map<K, List<Versioned<V>>> getAllWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) {
validateTimeout(requestWrapper.getRoutingTimeoutInMs());
Map<K, List<Versioned<V>>> items = null;
for(int attempts = 0;; attempts++) {
if(attempts >= this.metadataRefreshAttemp... | java |
public boolean deleteWithCustomTimeout(CompositeVoldemortRequest<K, V> deleteRequestObject) {
List<Versioned<V>> versionedValues;
validateTimeout(deleteRequestObject.getRoutingTimeoutInMs());
boolean hasVersion = deleteRequestObject.getVersion() == null ? false : true;
String keyHexStri... | java |
private void debugLogStart(String operationType,
Long originTimeInMS,
Long requestReceivedTimeInMs,
String keyString) {
long durationInMs = requestReceivedTimeInMs - originTimeInMS;
logger.debug("Received a new ... | java |
private void debugLogEnd(String operationType,
Long OriginTimeInMs,
Long RequestStartTimeInMs,
Long ResponseReceivedTimeInMs,
String keyString,
int numVectorClockEntries) {
... | java |
public static Node updateNode(Node node, List<Integer> partitionsList) {
return new Node(node.getId(),
node.getHost(),
node.getHttpPort(),
node.getSocketPort(),
node.getAdminPort(),
node.getZo... | java |
public static Node addPartitionToNode(final Node node, Integer donatedPartition) {
return UpdateClusterUtils.addPartitionsToNode(node, Sets.newHashSet(donatedPartition));
} | java |
public static Node removePartitionFromNode(final Node node, Integer donatedPartition) {
return UpdateClusterUtils.removePartitionsFromNode(node, Sets.newHashSet(donatedPartition));
} | java |
public static Node addPartitionsToNode(final Node node, final Set<Integer> donatedPartitions) {
List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds());
deepCopy.addAll(donatedPartitions);
Collections.sort(deepCopy);
return updateNode(node, deepCopy);
} | java |
public static Node removePartitionsFromNode(final Node node,
final Set<Integer> donatedPartitions) {
List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds());
deepCopy.removeAll(donatedPartitions);
return updateNode(node, deepCopy);
... | java |
public static Cluster createUpdatedCluster(Cluster currentCluster,
int stealerNodeId,
List<Integer> donatedPartitions) {
Cluster updatedCluster = Cluster.cloneCluster(currentCluster);
// Go over every donated p... | java |
public static void main(String[] args) {
DirectoryIterator iter = new DirectoryIterator(args);
while(iter.hasNext())
System.out.println(iter.next().getAbsolutePath());
} | java |
private void verifyClusterStoreDefinition() {
if(SystemStoreConstants.isSystemStore(storeDefinition.getName())) {
// TODO: Once "todo" in StorageService.initSystemStores is complete,
// this early return can be removed and verification can be enabled
// for system stores.
... | java |
public Integer getNodesPartitionIdForKey(int nodeId, final byte[] key) {
// this is all the partitions the key replicates to.
List<Integer> partitionIds = getReplicatingPartitionList(key);
for(Integer partitionId: partitionIds) {
// check which of the replicating partitions belongs t... | java |
private List<Integer> getNodeIdListForPartitionIdList(List<Integer> partitionIds)
throws VoldemortException {
List<Integer> nodeIds = new ArrayList<Integer>(partitionIds.size());
for(Integer partitionId: partitionIds) {
int nodeId = getNodeIdForPartitionId(partitionId);
... | java |
public boolean checkKeyBelongsToNode(byte[] key, int nodeId) {
List<Integer> nodePartitions = cluster.getNodeById(nodeId).getPartitionIds();
List<Integer> replicatingPartitions = getReplicatingPartitionList(key);
// remove all partitions from the list, except those that belong to the
// ... | java |
public static List<Integer> checkKeyBelongsToPartition(byte[] key,
Set<Pair<Integer, HashMap<Integer, List<Integer>>>> stealerNodeToMappingTuples,
Cluster cluster,
... | java |
public synchronized void maybeThrottle(int eventsSeen) {
if (maxRatePerSecond > 0) {
long now = time.milliseconds();
try {
rateSensor.record(eventsSeen, now);
} catch (QuotaViolationException e) {
// If we're over quota, we calculate how long t... | java |
public List<NodeValue<K, V>> getRepairs(List<NodeValue<K, V>> nodeValues) {
int size = nodeValues.size();
if(size <= 1)
return Collections.emptyList();
Map<K, List<NodeValue<K, V>>> keyToNodeValues = Maps.newHashMap();
for(NodeValue<K, V> nodeValue: nodeValues) {
... | java |
public static List<Versioned<byte[]>> resolveVersions(List<Versioned<byte[]>> values) {
List<Versioned<byte[]>> resolvedVersions = new ArrayList<Versioned<byte[]>>(values.size());
// Go over all the values and determine whether the version is
// acceptable
for(Versioned<byte[]> value: va... | java |
public static VectorClock makeClock(Set<Integer> serverIds, long clockValue, long timestamp) {
List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverIds.size());
for(Integer serverId: serverIds) {
clockEntries.add(new ClockEntry(serverId.shortValue(), clockValue));
}
... | java |
private String swapStore(String storeName, String directory) throws VoldemortException {
ReadOnlyStorageEngine store = getReadOnlyStorageEngine(metadataStore,
storeRepository,
storeName... | java |
@Override
public boolean isCompleteRequest(ByteBuffer buffer) {
DataInputStream inputStream = new DataInputStream(new ByteBufferBackedInputStream(buffer));
try {
int dataSize = inputStream.readInt();
if(logger.isTraceEnabled())
logger.trace("In isCompleteReq... | java |
public synchronized void unregisterJmxIfRequired() {
referenceCount--;
if (isRegistered == true && referenceCount <= 0) {
JmxUtils.unregisterMbean(this.jmxObjectName);
isRegistered = false;
}
} | java |
public static String toBinaryString(byte[] bytes) {
StringBuilder buffer = new StringBuilder();
for(byte b: bytes) {
String bin = Integer.toBinaryString(0xFF & b);
bin = bin.substring(0, Math.min(bin.length(), 8));
for(int j = 0; j < 8 - bin.length(); j++) {
... | java |
public static byte[] copy(byte[] array, int from, int to) {
if(to - from < 0) {
return new byte[0];
} else {
byte[] a = new byte[to - from];
System.arraycopy(array, from, a, 0, to - from);
return a;
}
} | java |
public static int readInt(byte[] bytes, int offset) {
return (((bytes[offset + 0] & 0xff) << 24) | ((bytes[offset + 1] & 0xff) << 16)
| ((bytes[offset + 2] & 0xff) << 8) | (bytes[offset + 3] & 0xff));
} | java |
public static long readUnsignedInt(byte[] bytes, int offset) {
return (((bytes[offset + 0] & 0xffL) << 24) | ((bytes[offset + 1] & 0xffL) << 16)
| ((bytes[offset + 2] & 0xffL) << 8) | (bytes[offset + 3] & 0xffL));
} | java |
public static long readBytes(byte[] bytes, int offset, int numBytes) {
int shift = 0;
long value = 0;
for(int i = offset + numBytes - 1; i >= offset; i--) {
value |= (bytes[i] & 0xFFL) << shift;
shift += 8;
}
return value;
} | java |
public static void writeShort(byte[] bytes, short value, int offset) {
bytes[offset] = (byte) (0xFF & (value >> 8));
bytes[offset + 1] = (byte) (0xFF & value);
} | java |
public static void writeUnsignedShort(byte[] bytes, int value, int offset) {
bytes[offset] = (byte) (0xFF & (value >> 8));
bytes[offset + 1] = (byte) (0xFF & value);
} | java |
public static void writeInt(byte[] bytes, int value, int offset) {
bytes[offset] = (byte) (0xFF & (value >> 24));
bytes[offset + 1] = (byte) (0xFF & (value >> 16));
bytes[offset + 2] = (byte) (0xFF & (value >> 8));
bytes[offset + 3] = (byte) (0xFF & value);
} | java |
public static void writeBytes(byte[] bytes, long value, int offset, int numBytes) {
int shift = 0;
for(int i = offset + numBytes - 1; i >= offset; i--) {
bytes[i] = (byte) (0xFF & (value >> shift));
shift += 8;
}
} | java |
public static byte numberOfBytesRequired(long number) {
if(number < 0)
number = -number;
for(byte i = 1; i <= SIZE_OF_LONG; i++)
if(number < (1L << (8 * i)))
return i;
throw new IllegalStateException("Should never happen.");
} | java |
public static void read(InputStream stream, byte[] buffer) throws IOException {
int read = 0;
while(read < buffer.length) {
int newlyRead = stream.read(buffer, read, buffer.length - read);
if(newlyRead == -1)
throw new EOFException("Attempt to read " + buffer.leng... | java |
public static byte[] getBytes(String string, String encoding) {
try {
return string.getBytes(encoding);
} catch(UnsupportedEncodingException e) {
throw new IllegalArgumentException(encoding + " is not a known encoding name.", e);
}
} | java |
public static String getString(byte[] bytes, String encoding) {
try {
return new String(bytes, encoding);
} catch(UnsupportedEncodingException e) {
throw new IllegalArgumentException(encoding + " is not a known encoding name.", e);
}
} | java |
public void addRequest(long timeNS,
long numEmptyResponses,
long valueBytes,
long keyBytes,
long getAllAggregatedCount) {
// timing instrumentation (trace only)
long startTimeNs = 0;
if(lo... | java |
public void addEvent(Event event) {
if(event == null)
throw new IllegalStateException("event must be non-null");
if(logger.isTraceEnabled())
logger.trace("Adding event " + event);
eventQueue.add(event);
} | java |
public void execute() {
try {
while(true) {
Event event = null;
try {
event = eventQueue.poll(timeout, unit);
} catch(InterruptedException e) {
throw new InsufficientOperationalNodesException(operation.getSimple... | java |
public static ModelMBean createModelMBean(Object o) {
try {
ModelMBean mbean = new RequiredModelMBean();
JmxManaged annotation = o.getClass().getAnnotation(JmxManaged.class);
String description = annotation == null ? "" : annotation.description();
ModelMBeanInfo i... | java |
public static ModelMBeanOperationInfo[] extractOperationInfo(Object object) {
ArrayList<ModelMBeanOperationInfo> infos = new ArrayList<ModelMBeanOperationInfo>();
for(Method m: object.getClass().getMethods()) {
JmxOperation jmxOperation = m.getAnnotation(JmxOperation.class);
JmxG... | java |
public static MBeanParameterInfo[] extractParameterInfo(Method m) {
Class<?>[] types = m.getParameterTypes();
Annotation[][] annotations = m.getParameterAnnotations();
MBeanParameterInfo[] params = new MBeanParameterInfo[types.length];
for(int i = 0; i < params.length; i++) {
... | java |
public static ObjectName createObjectName(String domain, String type) {
try {
return new ObjectName(domain + ":type=" + type);
} catch(MalformedObjectNameException e) {
throw new VoldemortException(e);
}
} | java |
public static String getClassName(Class<?> c) {
String name = c.getName();
return name.substring(name.lastIndexOf('.') + 1, name.length());
} | java |
public static void registerMbean(Object mbean, ObjectName name) {
registerMbean(ManagementFactory.getPlatformMBeanServer(),
JmxUtils.createModelMBean(mbean),
name);
} | java |
public static ObjectName registerMbean(String typeName, Object obj) {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName name = JmxUtils.createObjectName(JmxUtils.getPackageName(obj.getClass()),
typeName);
registerMbean... | java |
public static void registerMbean(MBeanServer server, ModelMBean mbean, ObjectName name) {
try {
synchronized(LOCK) {
if(server.isRegistered(name))
JmxUtils.unregisterMbean(server, name);
server.registerMBean(mbean, name);
}
} ca... | java |
public static void unregisterMbean(MBeanServer server, ObjectName name) {
try {
server.unregisterMBean(name);
} catch(Exception e) {
logger.error("Error unregistering mbean", e);
}
} | java |
public static void unregisterMbean(ObjectName name) {
try {
ManagementFactory.getPlatformMBeanServer().unregisterMBean(name);
} catch(Exception e) {
logger.error("Error unregistering mbean", e);
}
} | java |
public static boolean isFormatCorrect(String fileName, ReadOnlyStorageFormat format) {
switch(format) {
case READONLY_V0:
case READONLY_V1:
if(fileName.matches("^[\\d]+_[\\d]+\\.(data|index)")) {
return true;
} else {
... | java |
public static int getChunkId(String fileName) {
Pattern pattern = Pattern.compile("_[\\d]+\\.");
Matcher matcher = pattern.matcher(fileName);
if(matcher.find()) {
return new Integer(fileName.substring(matcher.start() + 1, matcher.end() - 1));
} else {
throw new V... | java |
public static File getCurrentVersion(File storeDirectory) {
File latestDir = getLatestDir(storeDirectory);
if(latestDir != null)
return latestDir;
File[] versionDirs = getVersionDirs(storeDirectory);
if(versionDirs == null || versionDirs.length == 0) {
return nul... | java |
public static boolean checkVersionDirName(File versionDir) {
return (versionDir.isDirectory() && versionDir.getName().contains("version-") && !versionDir.getName()
.endsWith(".bak"));
} | java |
private static long getVersionId(String versionDir) {
try {
return Long.parseLong(versionDir.replace("version-", ""));
} catch(NumberFormatException e) {
logger.trace("Cannot parse version directory to obtain id " + versionDir);
return -1;
}
} | java |
public static File[] getVersionDirs(File rootDir, final long minId, final long maxId) {
return rootDir.listFiles(new FileFilter() {
public boolean accept(File pathName) {
if(checkVersionDirName(pathName)) {
long versionId = getVersionId(pathName);
... | java |
@Override
protected void stopInner() throws VoldemortException {
List<VoldemortException> exceptions = new ArrayList<VoldemortException>();
logger.info("Stopping services:" + getIdentityNode().getId());
/* Stop in reverse order */
exceptions.addAll(stopOnlineServices());
for... | java |
private int getReplicaTypeForPartition(int partitionId) {
List<Integer> routingPartitionList = routingStrategy.getReplicatingPartitionList(partitionId);
// Determine if we should host this partition, and if so, whether we are a primary,
// secondary or n-ary replica for it
int correctRe... | java |
private void renameReadOnlyV2Files(int masterPartitionId, int correctReplicaType) {
for (int replica = 0; replica < routingStrategy.getNumReplicas(); replica++) {
if (replica != correctReplicaType) {
int chunkId = 0;
while (true) {
String fileName ... | java |
public byte[] keyToStorageFormat(byte[] key) {
switch(getReadOnlyStorageFormat()) {
case READONLY_V0:
case READONLY_V1:
return ByteUtils.md5(key);
case READONLY_V2:
return ByteUtils.copy(ByteUtils.md5(key), 0, 2 * ByteUtils.SIZE_OF_INT);
... | java |
public int getChunkForKey(byte[] key) throws IllegalStateException {
if(numChunks == 0) {
throw new IllegalStateException("The ChunkedFileSet is closed.");
}
switch(storageFormat) {
case READONLY_V0: {
return ReadOnlyUtils.chunk(ByteUtils.md5(key), numChu... | java |
private static List<String> parseAndCompare(List<String> fileNames, int masterPartitionId) {
List<String> sourceFileNames = new ArrayList<String>();
for(String fileName: fileNames) {
String[] partitionIdReplicaChunk = fileName.split(SPLIT_LITERAL);
if(Integer.parseInt(partitionId... | java |
@JmxGetter(name = "getChunkIdToNumChunks", description = "Returns a string representation of the map of chunk id to number of chunks")
public String getChunkIdToNumChunks() {
StringBuilder builder = new StringBuilder();
for(Entry<Object, Integer> entry: fileSet.getChunkIdToNumChunks().entrySet()) {
... | java |
public void open(File versionDir) {
/* acquire modification lock */
fileModificationLock.writeLock().lock();
try {
/* check that the store is currently closed */
if(isOpen)
throw new IllegalStateException("Attempt to open already open store.");
... | java |
@JmxGetter(name = "lastSwapped", description = "Time in milliseconds since the store was swapped")
public long getLastSwapped() {
long timeSinceLastSwap = System.currentTimeMillis() - lastSwapped;
return timeSinceLastSwap > 0 ? timeSinceLastSwap : 0;
} | java |
@Override
public void close() throws VoldemortException {
logger.debug("Close called for read-only store.");
this.fileModificationLock.writeLock().lock();
try {
if(isOpen) {
this.isOpen = false;
fileSet.close();
} else {
... | java |
@JmxOperation(description = "swapFiles changes this store to use the new data directory")
public void swapFiles(String newStoreDirectory) {
logger.info("Swapping files for store '" + getName() + "' to " + newStoreDirectory);
File newVersionDir = new File(newStoreDirectory);
if(!newVersionDi... | java |
private void deleteBackups() {
File[] storeDirList = ReadOnlyUtils.getVersionDirs(storeDir, 0L, getCurrentVersionId());
if(storeDirList != null && storeDirList.length > (numBackups + 1)) {
// delete ALL old directories asynchronously
File[] extraBackups = ReadOnlyUtils.findKthVer... | java |
private void deleteAsync(final File file) {
new Thread(new Runnable() {
@Override
public void run() {
try {
try {
logger.info("Waiting for " + deleteBackupMs
+ " milliseconds before deleting ... | java |
public void rollback(File rollbackToDir) {
logger.info("Rolling back store '" + getName() + "'");
fileModificationLock.writeLock().lock();
try {
if(rollbackToDir == null)
throw new VoldemortException("Version directory specified to rollback is null");
if(... | java |
protected boolean hasTimeOutHeader() {
boolean result = false;
String timeoutValStr = this.request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_TIMEOUT_MS);
if(timeoutValStr != null) {
try {
this.parsedTimeoutInMs = Long.parseLong(timeoutValStr);
if(th... | java |
protected void parseRoutingCodeHeader() {
String rtCode = this.request.getHeader(RestMessageHeaders.X_VOLD_ROUTING_TYPE_CODE);
if(rtCode != null) {
try {
int routingTypeCode = Integer.parseInt(rtCode);
this.parsedRoutingType = RequestRoutingType.getRequestRou... | java |
protected boolean hasTimeStampHeader() {
String originTime = request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_ORIGIN_TIME_MS);
boolean result = false;
if(originTime != null) {
try {
// TODO: remove the originTime field from request header,
// becaus... | java |
protected boolean hasVectorClock(boolean isVectorClockOptional) {
boolean result = false;
String vectorClockHeader = this.request.getHeader(RestMessageHeaders.X_VOLD_VECTOR_CLOCK);
if(vectorClockHeader != null) {
ObjectMapper mapper = new ObjectMapper();
try {
... | java |
protected boolean hasKey() {
boolean result = false;
String requestURI = this.request.getUri();
parseKeys(requestURI);
if(this.parsedKeys != null) {
result = true;
} else {
logger.error("Error when validating request. No key specified.");
Rest... | java |
protected boolean isStoreValid() {
boolean result = false;
String requestURI = this.request.getUri();
this.storeName = parseStoreName(requestURI);
if(storeName != null) {
result = true;
} else {
logger.error("Error when validating request. Missing store na... | java |
protected void debugLog(String operationType, Long receivedTimeInMs) {
long durationInMs = receivedTimeInMs - (this.parsedRequestOriginTimeInMs);
int numVectorClockEntries = (this.parsedVectorClock == null ? 0
: this.parsedVectorClock.ge... | java |
@Deprecated
@Override
public File fetch(String source, String dest, long diskQuotaSizeInKB) throws Exception {
return fetchFromSource(source, dest, null, null, -1, diskQuotaSizeInKB, null);
} | java |
public static void main(String[] args) throws Exception {
if(args.length < 1)
Utils.croak("USAGE: java " + HdfsFetcher.class.getName()
+ " url [keytab-location kerberos-username hadoop-config-path [destDir]]");
String url = args[0];
VoldemortConfig config = n... | java |
public synchronized int getPartitionStoreMoves() {
int count = 0;
for (List<Integer> entry : storeToPartitionIds.values())
count += entry.size();
return count;
} | java |
public synchronized int getPartitionStoreCount() {
int count = 0;
for (String store : storeToPartitionIds.keySet()) {
count += storeToPartitionIds.get(store).size();
}
return count;
} | java |
public static String taskListToString(List<RebalanceTaskInfo> infos) {
StringBuffer sb = new StringBuffer();
for (RebalanceTaskInfo info : infos) {
sb.append("\t").append(info.getDonorId()).append(" -> ").append(info.getStealerId()).append(" : [");
for (String storeName : info.ge... | java |
@Override
public void map(GenericData.Record record,
AvroCollector<Pair<ByteBuffer, ByteBuffer>> collector,
Reporter reporter) throws IOException {
byte[] keyBytes = null;
byte[] valBytes = null;
Object keyRecord = null;
Object valRecord = nul... | java |
public static Pointer mmap(long len, int prot, int flags, int fildes, long off)
throws IOException {
// we don't really have a need to change the recommended pointer.
Pointer addr = new Pointer(0);
Pointer result = Delegate.mmap(addr,
new Nati... | java |
public static void mlock(Pointer addr, long len) {
int res = Delegate.mlock(addr, new NativeLong(len));
if(res != 0) {
if(logger.isDebugEnabled()) {
logger.debug("Mlock failed probably because of insufficient privileges, errno:"
+ errno.strerror(... | java |
public static void munlock(Pointer addr, long len) {
if(Delegate.munlock(addr, new NativeLong(len)) != 0) {
if(logger.isDebugEnabled())
logger.debug("munlocking failed with errno:" + errno.strerror());
} else {
if(logger.isDebugEnabled())
logger.d... | java |
public JsonTypeDefinition projectionType(String... properties) {
if(this.getType() instanceof Map<?, ?>) {
Map<?, ?> type = (Map<?, ?>) getType();
Arrays.sort(properties);
Map<String, Object> newType = new LinkedHashMap<String, Object>();
for(String prop: properti... | java |
private void writeBufferedValsToStorage() {
List<Versioned<byte[]>> obsoleteVals = storageEngine.multiVersionPut(currBufferedKey,
currBufferedVals);
// log Obsolete versions in debug mode
if(logger.isDebugEnabled() && o... | java |
public synchronized boolean acquireRebalancingPermit(int nodeId) {
boolean added = rebalancePermits.add(nodeId);
logger.info("Acquiring rebalancing permit for node id " + nodeId + ", returned: " + added);
return added;
} | java |
public synchronized void releaseRebalancingPermit(int nodeId) {
boolean removed = rebalancePermits.remove(nodeId);
logger.info("Releasing rebalancing permit for node id " + nodeId + ", returned: " + removed);
if(!removed)
throw new VoldemortException(new IllegalStateException("Invali... | java |
private void swapROStores(List<String> swappedStoreNames, boolean useSwappedStoreNames) {
try {
for(StoreDefinition storeDef: metadataStore.getStoreDefList()) {
// Only pick up the RO stores
if(storeDef.getType().compareTo(ReadOnlyStorageConfiguration.TYPE_NAME) == ... | java |
private void changeClusterAndStores(String clusterKey,
final Cluster cluster,
String storesKey,
final List<StoreDefinition> storeDefs) {
metadataStore.writeLock.lock();
try {
... | java |
public int rebalanceNode(final RebalanceTaskInfo stealInfo) {
final RebalanceTaskInfo info = metadataStore.getRebalancerState()
.find(stealInfo.getDonorId());
// Do we have the plan in the state?
if(info == null) {
throw new Volde... | java |
protected void prepForWrite(SelectionKey selectionKey) {
if(logger.isTraceEnabled())
traceInputBufferState("About to clear read buffer");
if(requestHandlerFactory.shareReadWriteBuffer() == false) {
inputStream.clear();
}
if(logger.isTraceEnabled())
t... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.