code
stringlengths
73
34.1k
label
stringclasses
1 value
protected void populateTasksByStealer(List<StealerBasedRebalanceTask> sbTaskList) { // Setup mapping of stealers to work for this run. for(StealerBasedRebalanceTask task: sbTaskList) { if(task.getStealInfos().size() != 1) { throw new VoldemortException("StealerBasedRebalanceT...
java
protected synchronized StealerBasedRebalanceTask scheduleNextTask(boolean executeService) { // Make sure there is work left to do. if(doneSignal.getCount() == 0) { logger.info("All tasks completion signaled... returning"); return null; } // Limit number of tasks ...
java
public synchronized void addNodesToWorkerList(List<Integer> nodeIds) { // Bookkeeping for nodes that will be involved in the next task nodeIdsWithWork.addAll(nodeIds); logger.info("Node IDs with work: " + nodeIdsWithWork + " Newly added nodes " + nodeIds); }
java
public synchronized void doneTask(int stealerId, int donorId) { removeNodesFromWorkerList(Arrays.asList(stealerId, donorId)); numTasksExecuting--; doneSignal.countDown(); // Try and schedule more tasks now that resources may be available to do // so. scheduleMoreTasks(); ...
java
private List<Long> collectLongMetric(String metricGetterName) { List<Long> vals = new ArrayList<Long>(); for(BdbEnvironmentStats envStats: environmentStatsTracked) { vals.add((Long) ReflectUtils.callMethod(envStats, BdbEnvironmentStats.clas...
java
public static Iterable<String> toHexStrings(Iterable<ByteArray> arrays) { ArrayList<String> ret = new ArrayList<String>(); for(ByteArray array: arrays) ret.add(ByteUtils.toHexString(array.get())); return ret; }
java
@Override public void sendResponse(StoreStats performanceStats, boolean isFromLocalZone, long startTimeInMs) throws Exception { /* * Pay attention to the code below. Note that in this method we wrap a multiPart object with a mimeMessage. ...
java
public String getPublicConfigValue(String key) throws ConfigurationException { if (!allProps.containsKey(key)) { throw new UndefinedPropertyException("The requested config key does not exist."); } if (restrictedConfigs.contains(key)) { throw new ConfigurationException("Th...
java
private void checkRateLimit(String quotaKey, Tracked trackedOp) { String quotaValue = null; try { if(!metadataStore.getQuotaEnforcingEnabledUnlocked()) { return; } quotaValue = quotaStore.cacheGet(quotaKey); // Store may not have any quotas...
java
public synchronized void submitOperation(int requestId, AsyncOperation operation) { if(this.operations.containsKey(requestId)) throw new VoldemortException("Request " + requestId + " already submitted to the system"); this.operations.put(requestId, o...
java
public synchronized boolean isComplete(int requestId, boolean remove) { if (!operations.containsKey(requestId)) throw new VoldemortException("No operation with id " + requestId + " found"); if (operations.get(requestId).getStatus().isComplete()) { if (logger.isDebugEnabled()) ...
java
@JmxOperation(description = "Retrieve operation status") public String getStatus(int id) { try { return getOperationStatus(id).toString(); } catch(VoldemortException e) { return "No operation with id " + id + " found"; } }
java
public List<Integer> getAsyncOperationList(boolean showCompleted) { /** * Create a copy using an immutable set to avoid a * {@link java.util.ConcurrentModificationException} */ Set<Integer> keySet = ImmutableSet.copyOf(operations.keySet()); if(showCompleted) ...
java
@JmxOperation public String stopAsyncOperation(int requestId) { try { stopOperation(requestId); } catch(VoldemortException e) { return e.getMessage(); } return "Stopping operation " + requestId; }
java
@Override public void updateStoreDefinition(StoreDefinition storeDef) { this.storeDef = storeDef; if(storeDef.hasRetentionPeriod()) this.retentionTimeMs = storeDef.getRetentionDays() * Time.MS_PER_DAY; }
java
private List<Versioned<byte[]>> filterExpiredEntries(ByteArray key, List<Versioned<byte[]>> vals) { Iterator<Versioned<byte[]>> valsIterator = vals.iterator(); while(valsIterator.hasNext()) { Versioned<byte[]> val = valsIterator.next(); VectorClock clock = (VectorClock) val.getVe...
java
private synchronized void flushData() { BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(new File(this.inputPath))); for(String key: this.metadataMap.keySet()) { writer.write(NEW_PROPERTY_SEPARATOR + key.toString() + "]" + NEW_LINE); ...
java
public static String getSerializedVectorClock(VectorClock vc) { VectorClockWrapper vcWrapper = new VectorClockWrapper(vc); String serializedVC = ""; try { serializedVC = mapper.writeValueAsString(vcWrapper); } catch(Exception e) { e.printStackTrace(); } ...
java
public static String getSerializedVectorClocks(List<VectorClock> vectorClocks) { List<VectorClockWrapper> vectorClockWrappers = new ArrayList<VectorClockWrapper>(); for(VectorClock vc: vectorClocks) { vectorClockWrappers.add(new VectorClockWrapper(vc)); } String serializedVC ...
java
public static String constructSerializerInfoXml(StoreDefinition storeDefinition) { Element store = new Element(StoreDefinitionsMapper.STORE_ELMT); store.addContent(new Element(StoreDefinitionsMapper.STORE_NAME_ELMT).setText(storeDefinition.getName())); Element keySerializer = new Element(StoreDe...
java
public void updateMetadataVersions() { Properties versionProps = MetadataVersionStoreUtils.getProperties(this.systemStoreRepository.getMetadataVersionStore()); Long newVersion = fetchNewVersion(SystemStoreConstants.CLUSTER_VERSION_KEY, null, ...
java
public static void validateClusterStores(final Cluster cluster, final List<StoreDefinition> storeDefs) { // Constructing a StoreRoutingPlan has the (desirable in this // case) side-effect of verifying that the store definition is congruent // with the...
java
public static void validateCurrentFinalCluster(final Cluster currentCluster, final Cluster finalCluster) { validateClusterPartitionCounts(currentCluster, finalCluster); validateClusterNodeState(currentCluster, finalCluster); return; }
java
public static void validateInterimFinalCluster(final Cluster interimCluster, final Cluster finalCluster) { validateClusterPartitionCounts(interimCluster, finalCluster); validateClusterZonesSame(interimCluster, finalCluster); validateClusterNodeC...
java
public static void validateClusterPartitionCounts(final Cluster lhs, final Cluster rhs) { if(lhs.getNumberOfPartitions() != rhs.getNumberOfPartitions()) throw new VoldemortException("Total number of partitions should be equal [ lhs cluster (" + lhs.getNumberO...
java
public static void validateClusterPartitionState(final Cluster subsetCluster, final Cluster supersetCluster) { if(!supersetCluster.getNodeIds().containsAll(subsetCluster.getNodeIds())) { throw new VoldemortException("Superset cluster does not cont...
java
public static void validateClusterZonesSame(final Cluster lhs, final Cluster rhs) { Set<Zone> lhsSet = new HashSet<Zone>(lhs.getZones()); Set<Zone> rhsSet = new HashSet<Zone>(rhs.getZones()); if(!lhsSet.equals(rhsSet)) throw new VoldemortException("Zones are not the same [ lhs cluste...
java
public static void validateClusterNodeCounts(final Cluster lhs, final Cluster rhs) { if(!lhs.getNodeIds().equals(rhs.getNodeIds())) { throw new VoldemortException("Node ids are not the same [ lhs cluster node ids (" + lhs.getNodeIds() ...
java
public static Cluster vacateZone(Cluster currentCluster, int dropZoneId) { Cluster returnCluster = Cluster.cloneCluster(currentCluster); // Go over each node in the zone being dropped for(Integer nodeId: currentCluster.getNodeIdsInZone(dropZoneId)) { // For each node grab all the par...
java
public static Cluster dropZone(Cluster intermediateCluster, int dropZoneId) { // Filter out nodes that don't belong to the zone being dropped Set<Node> survivingNodes = new HashSet<Node>(); for(int nodeId: intermediateCluster.getNodeIds()) { if(intermediateCluster.getNodeById(nodeId)...
java
public static List<Integer> getStolenPrimaryPartitions(final Cluster currentCluster, final Cluster finalCluster, final int stealNodeId) { List<Integer> finalList = new ArrayList<Integer>(finalCl...
java
public static List<StoreDefinition> validateRebalanceStore(List<StoreDefinition> storeDefList) { List<StoreDefinition> returnList = new ArrayList<StoreDefinition>(storeDefList.size()); for(StoreDefinition def: storeDefList) { if(!def.isView() && !canRebalanceList.contains(def.getType())) { ...
java
public static void dumpClusters(Cluster currentCluster, Cluster finalCluster, String outputDirName, String filePrefix) { dumpClusterToFile(outputDirName, filePrefix + currentClusterFileName, currentCluste...
java
public static void dumpClusters(Cluster currentCluster, Cluster finalCluster, String outputDirName) { dumpClusters(currentCluster, finalCluster, outputDirName, ""); }
java
public static void dumpClusterToFile(String outputDirName, String fileName, Cluster cluster) { if(outputDirName != null) { File outputDir = new File(outputDirName); if(!outputDir.exists()) { Utils.mkdirs(outputDir); } try { FileUt...
java
public static void dumpStoreDefsToFile(String outputDirName, String fileName, List<StoreDefinition> storeDefs) { if(outputDirName != null) { File outputDir = new File(outputDirName); if(!outputDir.exis...
java
public static void dumpAnalysisToFile(String outputDirName, String baseFileName, PartitionBalance partitionBalance) { if(outputDirName != null) { File outputDir = new File(outputDirName); if(!outputDir.ex...
java
public static void dumpPlanToFile(String outputDirName, RebalancePlan plan) { if(outputDirName != null) { File outputDir = new File(outputDirName); if(!outputDir.exists()) { Utils.mkdirs(outputDir); } try { FileUtils.writeStringToFi...
java
public static List<RebalanceTaskInfo> filterTaskPlanWithStores(List<RebalanceTaskInfo> existingPlanList, List<StoreDefinition> storeDefs) { List<RebalanceTaskInfo> plans = Lists.newArrayList(); List<String> storeNames = StoreDefinitionUt...
java
public static void executorShutDown(ExecutorService executorService, long timeOutSec) { try { executorService.shutdown(); executorService.awaitTermination(timeOutSec, TimeUnit.SECONDS); } catch(Exception e) { logger.warn("Error while stoping executor service.", e); ...
java
public List<T> resolveConflicts(List<T> values) { if(values.size() > 1) return values; else return Collections.singletonList(values.get(0)); }
java
public static <K, V, T> List<Versioned<V>> get(Store<K, V, T> storageEngine, K key, T transform) { Map<K, List<Versioned<V>>> result = storageEngine.getAll(Collections.singleton(key), Collections.singletonMap(key, ...
java
public static <K, V, T> Map<K, List<Versioned<V>>> getAll(Store<K, V, T> storageEngine, Iterable<K> keys, Map<K, T> transforms) { Map<K, List<Versioned<V>>> result = newEmptyHashMap(keys);...
java
public static <K, V> HashMap<K, V> newEmptyHashMap(Iterable<?> iterable) { if(iterable instanceof Collection<?>) return Maps.newHashMapWithExpectedSize(((Collection<?>) iterable).size()); return Maps.newHashMap(); }
java
public static void assertValidMetadata(ByteArray key, RoutingStrategy routingStrategy, Node currentNode) { List<Node> nodes = routingStrategy.routeRequest(key.get()); for(Node node: nodes) { if(node.getId()...
java
public static void assertValidNode(MetadataStore metadataStore, Integer nodeId) { if(!metadataStore.getCluster().hasNodeWithId(nodeId)) { throw new InvalidMetadataException("NodeId " + nodeId + " is not or no longer in this cluster"); } }
java
@SuppressWarnings("unchecked") public static <T> Serializer<T> unsafeGetSerializer(SerializerFactory serializerFactory, SerializerDefinition serializerDefinition) { return (Serializer<T>) serializerFactory.getSerializer(serializerDefinition); }
java
public static StoreDefinition getStoreDef(List<StoreDefinition> list, String name) { for(StoreDefinition def: list) if(def.getName().equals(name)) return def; return null; }
java
public static List<String> getStoreNames(List<StoreDefinition> list, boolean ignoreViews) { List<String> storeNameSet = new ArrayList<String>(); for(StoreDefinition def: list) if(!def.isView() || !ignoreViews) storeNameSet.add(def.getName()); return storeNameSet; ...
java
private void plan() { // Mapping of stealer node to list of primary partitions being moved final TreeMultimap<Integer, Integer> stealerToStolenPrimaryPartitions = TreeMultimap.create(); // Output initial and final cluster if(outputDir != null) RebalanceUtils.dumpClusters(cur...
java
private String storageOverhead(Map<Integer, Integer> finalNodeToOverhead) { double maxOverhead = Double.MIN_VALUE; PartitionBalance pb = new PartitionBalance(currentCluster, currentStoreDefs); StringBuilder sb = new StringBuilder(); sb.append("Per-node store-overhead:").append(Utils.NEWL...
java
public static Boolean askConfirm(Boolean confirm, String opDesc) throws IOException { if(confirm) { System.out.println("Confirmed " + opDesc + " in command-line."); return true; } else { System.out.println("Are you sure you want to " + opDesc + "? (yes/no)"); ...
java
public static List<String> getValueList(List<String> valuePairs, String delim) { List<String> valueList = Lists.newArrayList(); for(String valuePair: valuePairs) { String[] value = valuePair.split(delim, 2); if(value.length != 2) throw new VoldemortException("Inva...
java
public static <V> Map<V, V> convertListToMap(List<V> list) { Map<V, V> map = new HashMap<V, V>(); if(list.size() % 2 != 0) throw new VoldemortException("Failed to convert list to map."); for(int i = 0; i < list.size(); i += 2) { map.put(list.get(i), list.get(i + 1)); ...
java
public static AdminClient getAdminClient(String url) { ClientConfig config = new ClientConfig().setBootstrapUrls(url) .setConnectionTimeout(5, TimeUnit.SECONDS); AdminClientConfig adminConfig = new AdminClientConfig().setAdminSocketTimeoutSec(5); ...
java
public static List<Integer> getAllNodeIds(AdminClient adminClient) { List<Integer> nodeIds = Lists.newArrayList(); for(Integer nodeId: adminClient.getAdminClientCluster().getNodeIds()) { nodeIds.add(nodeId); } return nodeIds; }
java
public static List<String> getAllUserStoreNamesOnNode(AdminClient adminClient, Integer nodeId) { List<String> storeNames = Lists.newArrayList(); List<StoreDefinition> storeDefinitionList = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeId) ...
java
public static void validateUserStoreNamesOnNode(AdminClient adminClient, Integer nodeId, List<String> storeNames) { List<StoreDefinition> storeDefList = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeI...
java
public static List<Integer> getAllPartitions(AdminClient adminClient) { List<Integer> partIds = Lists.newArrayList(); partIds = Lists.newArrayList(); for(Node node: adminClient.getAdminClientCluster().getNodes()) { partIds.addAll(node.getPartitionIds()); } return part...
java
public static List<QuotaType> getQuotaTypes(List<String> strQuotaTypes) { if(strQuotaTypes.size() < 1) { throw new VoldemortException("Quota type not specified."); } List<QuotaType> quotaTypes; if(strQuotaTypes.size() == 1 && strQuotaTypes.get(0).equals(AdminToolUtils.QUOTATY...
java
public static File createDir(String dir) { // create outdir File directory = null; if(dir != null) { directory = new File(dir); if(!(directory.exists() || directory.mkdir())) { Utils.croak("Can't find or create directory " + dir); } } ...
java
public static Map<String, StoreDefinition> getSystemStoreDefMap() { Map<String, StoreDefinition> sysStoreDefMap = Maps.newHashMap(); List<StoreDefinition> storesDefs = SystemStoreConstants.getAllSystemStoreDefs(); for(StoreDefinition def: storesDefs) { sysStoreDefMap.put(def.getName(...
java
public static Map<String, StoreDefinition> getUserStoreDefMapOnNode(AdminClient adminClient, Integer nodeId) { List<StoreDefinition> storeDefinitionList = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeId) ...
java
public static RebalanceTaskInfo decodeRebalanceTaskInfoMap(VAdminProto.RebalanceTaskInfoMap rebalanceTaskInfoMap) { RebalanceTaskInfo rebalanceTaskInfo = new RebalanceTaskInfo( rebalanceTaskInfoMap.getStealerId(), ...
java
public static RebalanceTaskInfoMap encodeRebalanceTaskInfoMap(RebalanceTaskInfo stealInfo) { return RebalanceTaskInfoMap.newBuilder() .setStealerId(stealInfo.getStealerId()) .setDonorId(stealInfo.getDonorId()) ...
java
public Versioned<E> getVersionedById(int id) { Versioned<VListNode<E>> listNode = getListNode(id); if(listNode == null) throw new IndexOutOfBoundsException(); return new Versioned<E>(listNode.getValue().getValue(), listNode.getVersion()); }
java
public E setById(final int id, final E element) { VListKey<K> key = new VListKey<K>(_key, id); UpdateElementById<K, E> updateElementAction = new UpdateElementById<K, E>(key, element); if(!_storeClient.applyUpdate(updateElementAction)) throw new ObsoleteVersionException("update faile...
java
private void allClustersEqual(final List<String> clusterUrls) { Validate.notEmpty(clusterUrls, "clusterUrls cannot be null"); // If only one clusterUrl return immediately if (clusterUrls.size() == 1) return; AdminClient adminClientLhs = adminClientPerCluster.get(clusterUrls.g...
java
private synchronized JsonSchema getInputPathJsonSchema() throws IOException { if (inputPathJsonSchema == null) { // No need to query Hadoop more than once as this shouldn't change mid-run, // thus, we can lazily initialize and cache the result. inputPathJsonSchema = HadoopUti...
java
private synchronized Schema getInputPathAvroSchema() throws IOException { if (inputPathAvroSchema == null) { // No need to query Hadoop more than once as this shouldn't change mid-run, // thus, we can lazily initialize and cache the result. inputPathAvroSchema = AvroUtils.get...
java
public String getRecordSchema() throws IOException { Schema schema = getInputPathAvroSchema(); String recSchema = schema.toString(); return recSchema; }
java
public String getKeySchema() throws IOException { Schema schema = getInputPathAvroSchema(); String keySchema = schema.getField(keyFieldName).schema().toString(); return keySchema; }
java
public String getValueSchema() throws IOException { Schema schema = getInputPathAvroSchema(); String valueSchema = schema.getField(valueFieldName).schema().toString(); return valueSchema; }
java
private void verifyOrAddStore(String clusterURL, String keySchema, String valueSchema) { String newStoreDefXml = VoldemortUtils.getStoreDefXml( storeName, props.getInt(BUILD_REPLICATION_FACTOR, 2), ...
java
public void syncInternalStateFromFileSystem(boolean alsoSyncRemoteState) { // Make sure versions missing from the file-system are cleaned up from the internal state for (Long version: versionToEnabledMap.keySet()) { File[] existingVersionDirs = ReadOnlyUtils.getVersionDirs(rootDir, version, ...
java
private void persistDisabledVersion(long version) throws PersistenceFailureException { File disabledMarker = getDisabledMarkerFile(version); try { disabledMarker.createNewFile(); } catch (IOException e) { throw new PersistenceFailureException("Failed to create the disable...
java
private void persistEnabledVersion(long version) throws PersistenceFailureException { File disabledMarker = getDisabledMarkerFile(version); if (disabledMarker.exists()) { if (!disabledMarker.delete()) { throw new PersistenceFailureException("Failed to create the disabled mark...
java
private File getDisabledMarkerFile(long version) throws PersistenceFailureException { File[] versionDirArray = ReadOnlyUtils.getVersionDirs(rootDir, version, version); if (versionDirArray.length == 0) { throw new PersistenceFailureException("getDisabledMarkerFile did not find the requested v...
java
public Double getAvgEventValue() { resetIfNeeded(); synchronized(this) { long eventsLastInterval = numEventsLastInterval - numEventsLastLastInterval; if(eventsLastInterval > 0) return ((totalEventValueLastInterval - totalEventValueLastLastInterval) * 1.0) ...
java
@SuppressWarnings("unchecked") public static void executeCommand(String[] args) throws IOException { OptionParser parser = getParser(); // declare parameters List<String> metaKeys = null; String url = null; // parse command-line input ar...
java
@SuppressWarnings("unchecked") public static void executeCommand(String[] args) throws IOException { OptionParser parser = getParser(); // declare parameters String url = null; List<Integer> nodeIds = null; Boolean allNodes = true; Boolea...
java
public static void doMetaClearRebalance(AdminClient adminClient, List<Integer> nodeIds) { AdminToolUtils.assertServerNotInOfflineState(adminClient, nodeIds); System.out.println("Setting " + MetadataStore.SERVER_STATE_KEY + " to " + MetadataStore.VoldemortState.NORM...
java
@SuppressWarnings("unchecked") public static void executeCommand(String[] args) throws IOException { OptionParser parser = getParser(); // declare parameters List<String> metaKeys = null; String url = null; String dir = null; List<Integer...
java
@SuppressWarnings("unchecked") public static void executeCommand(String[] args) throws IOException { OptionParser parser = getParser(); // declare parameters List<String> metaKeys = null; String url = null; List<Integer> nodeIds = null; B...
java
public static void doMetaGetRO(AdminClient adminClient, Collection<Integer> nodeIds, List<String> storeNames, List<String> metaKeys) throws IOException { for(String key: metaKeys) { ...
java
public static void doMetaUpdateVersionsOnStores(AdminClient adminClient, List<StoreDefinition> oldStoreDefs, List<StoreDefinition> newStoreDefs) { Set<String> storeNamesUnion = new HashSet<String>...
java
public static void executeCommand(String[] args) throws IOException { OptionParser parser = getParser(); String url = null; Boolean confirm = false; // parse command-line input OptionSet options = parser.parse(args); if(options.has(AdminParserUti...
java
public static void executeCommand(String[] args) throws IOException { OptionParser parser = getParser(); // declare parameters String url = null; // parse command-line input OptionSet options = parser.parse(args); if(options.has(AdminParserUtils...
java
private Integer getKeyPartitionId(byte[] key) { Integer keyPartitionId = storeInstance.getNodesPartitionIdForKey(nodeId, key); Utils.notNull(keyPartitionId); return keyPartitionId; }
java
protected boolean isItemAccepted(byte[] key) { boolean entryAccepted = false; if (!fetchOrphaned) { if (isKeyNeeded(key)) { entryAccepted = true; } } else { if (!StoreRoutingPlan.checkKeyBelongsToNode(key, nodeId, initialCluster, storeDef)) { ...
java
protected void accountForFetchedKey(byte[] key) { fetched++; if (streamStats != null) { streamStats.reportStreamingFetch(operation); } if (recordsPerPartition <= 0) { return; } Integer keyPartitionId = getKeyPartitionId(key); Long partiti...
java
protected StreamRequestHandlerState determineRequestHandlerState(String itemTag) { if (keyIterator.hasNext() && !fetchedEnoughForAllPartitions()) { return StreamRequestHandlerState.WRITING; } else { logger.info("Finished fetch " + itemTag + " for store '" + storageEngine.getName...
java
protected List<Versioned<V>> resolveAndConstructVersionsToPersist(List<Versioned<V>> valuesInStorage, List<Versioned<V>> multiPutValues) { List<Versioned<V>> obsoleteVals = new ArrayList<Versioned<V>>(multiPutValues.size()); // Go ove...
java
private <T> InternalProviderImpl installInternalProvider(Class<T> clazz, String bindingName, InternalProviderImpl<? extends T> internalProvider, boolean isBound, boolean isTestProvider) { if (bindingName == null) { if (isBound) { return installUnNamedProvider(mapClassesToUnNamedBoundProviders, c...
java
@Override protected void reset() { super.reset(); mapClassesToNamedBoundProviders.clear(); mapClassesToUnNamedBoundProviders.clear(); hasTestModules = false; installBindingForScope(); }
java
public synchronized T get(Scope scope) { if (instance != null) { return instance; } if (providerInstance != null) { if (isProvidingSingletonInScope) { instance = providerInstance.get(); //gc providerInstance = null; return instance; } return provider...
java
public static void closeScope(Object name) { //we remove the scope first, so that other threads don't see it, and see the next snapshot of the tree ScopeNode scope = (ScopeNode) MAP_KEY_TO_SCOPE.remove(name); if (scope != null) { ScopeNode parentScope = scope.getParentScope(); if (parentScope !=...
java
public static void reset() { for (Object name : Collections.list(MAP_KEY_TO_SCOPE.keys())) { closeScope(name); } ConfigurationHolder.configuration.onScopeForestReset(); ScopeImpl.resetUnBoundProviders(); }
java
void notifyMwRevisionProcessors(MwRevision mwRevision, boolean isCurrent) { if (mwRevision == null || mwRevision.getPageId() <= 0) { return; } for (MwRevisionProcessorBroker.RevisionSubscription rs : this.revisionSubscriptions) { if (rs.onlyCurrentRevisions == isCurrent && (rs.model == null || mwRevisi...
java
static ItemIdValueImpl fromIri(String iri) { int separator = iri.lastIndexOf('/') + 1; try { return new ItemIdValueImpl(iri.substring(separator), iri.substring(0, separator)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid Wikibase entity IRI: " + iri, e); } }
java