Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
package org.apache.batik.gvt.renderer; import org.apache.batik.gvt.filter.ConcreteGraphicsNodeRableFactory; import org.apache.batik.gvt.text.ConcreteTextSelector;
0
import java.util.HashMap; import java.util.Map; JSONObject entity = new JSONObject(); Map<String, String> errors = new HashMap<>(); errors.put("message", "Ldap password required"); entity.put("errors", errors); return Response.status(Response.Status.UNAUTHORIZED).entity(entity).build(); if(isLoginError(e)) { JSONObject entity = new JSONObject(); Map<String, String> errors = new HashMap<>(); errors.put("message", "Authentication Exception"); entity.put("errors", errors); return Response.status(Response.Status.UNAUTHORIZED).entity(entity).build(); } else return attemptHiveConnection(request.password);
0
package org.apache.batik.anim.dom; import org.apache.batik.dom.svg.SVGOMEvent;
0
import com.twitter.common.application.ActionRegistry; import com.twitter.common.base.Command; * * @param shutdownRegistry to register orderly shutdown of the periodic task scheduler. void startPeriodicTasks(ActionRegistry shutdownRegistry) { new ResourceManager(this, executorRootDir, shutdownRegistry).start(); shutdownRegistry.addAction(new Command() { @Override public void execute() { LOG.info("Shutting down sync executor."); syncExecutor.shutdownNow(); } });
0
import org.apache.hc.core5.reactor.IOSession; private final IOSession ioSession; public ManagedAsyncClientConnection(final IOSession ioSession) { if (ioSession instanceof TransportSecurityLayer) { ((TransportSecurityLayer) ioSession).startTls(sslContext, sslBufferManagement, initializer, verifier); } else { throw new UnsupportedOperationException("TLS upgrade not supported"); } return ioSession instanceof TransportSecurityLayer ? ((TransportSecurityLayer) ioSession).getTlsDetails() : null; final TlsDetails tlsDetails = getTlsDetails();
0
if(entry.before == null) { throw new IllegalStateException("Entry.before is null." + " Please check that your keys are immutable, and that you have used synchronization properly." + " If so, then please report this to dev@commons.apache.org as a bug."); }
0
import java.awt.image.DataBufferInt; import java.awt.image.SinglePixelPackedSampleModel; BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); return bi; // // This is a trick so that viewers which do not support // the alpha channel will see a white background (and not // a black one). // int w = img.getWidth(), h = img.getHeight(); DataBufferInt biDB = (DataBufferInt)img.getRaster().getDataBuffer(); int scanStride = ((SinglePixelPackedSampleModel)img.getSampleModel()).getScanlineStride(); int dbOffset = biDB.getOffset(); int pixels[] = biDB.getBankData()[0]; int p = dbOffset; int adjust = scanStride - w; int a=0, r=0, g=0, b=0, pel=0; for(int i=0; i<h; i++){ for(int j=0; j<w; j++){ pel = pixels[p]; a = (pel >> 24) & 0xff; r = (pel >> 16) & 0xff; g = (pel >> 8 ) & 0xff; b = pel & 0xff; r = (255*(255 -a) + a*r)/255; g = (255*(255 -a) + a*g)/255; b = (255*(255 -a) + a*b)/255; pixels[p++] = (a<<24 & 0xff000000) | (r<<16 & 0xff0000) | (g<<8 & 0xff00) | (b & 0xff); } p += adjust; }
0
if (values.isEmpty()) { return false; }
0
* Returns the xml:base attribute value of the given element. */ public static String getXMLBase(Element elt) { return elt.getAttributeNS(XML_NAMESPACE_URI, "base"); } /** public static String getCascadedXMLBase(Element elt) { base = getCascadedXMLBase((Element)n);
0
package org.apache.accumulo.examples.wikisearch.ingest; import org.apache.accumulo.examples.wikisearch.ingest.ArticleExtractor.Article; import org.apache.accumulo.examples.wikisearch.normalizer.LcNoDiacriticsNormalizer; import org.apache.accumulo.examples.wikisearch.protobuf.Uid; import org.apache.accumulo.examples.wikisearch.protobuf.Uid.List.Builder;
0
import java.net.ConnectException; if (io instanceof SocketTimeoutException || io instanceof ConnectException) { errorMsg = "Cannot connect to collector: SocketTimeoutException for " + uriBuilder.getHost();
0
* A {@link PCollectionViewWriter} is responsible for writing contents of a {@link PCollection} to a * storage mechanism that can be read from while constructing a {@link PCollectionView}.
1
// throw new FormsException("Widget to inherit from ("+newId+") not // found!", DomHelper.getLocationObject(element));
0
* Invoked when the consumer is being closed. * * @since 4.3 */ protected void onClose() throws IOException { } /** onClose();
0
import org.apache.accumulo.core.clientImpl.Table; import org.apache.accumulo.core.clientImpl.Tables;
0
import org.apache.hc.core5.annotation.Contract; import org.apache.hc.core5.annotation.ThreadingBehavior; @Contract(threading = ThreadingBehavior.IMMUTABLE)
0
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
1
* Generates class index for a given package. * @version CVS $Id$ public class PackageXMLWriter extends AbstractXMLWriter {
0
@Nullable return getTransformEvaluatorQueue(transform, evaluationContext).poll();
0
report.addDescriptionEntry(Messages.formatMessage(ENTRY_KEY_LINE_NUMBER,null), ln); report.addDescriptionEntry(Messages.formatMessage(ENTRY_KEY_COLUMN_NUMBER,null), cn);
0
* @version $Revision: 1.3 $, $Date: 2004/10/21 18:42:09 $ /** * <p><strong>This operation is not supported and will throw an * UnsupportedOperationException.</strong></p> * * @throws UnsupportedOperationException */ /** * <p><strong>This operation is not supported and will throw an * UnsupportedOperationException.</strong></p> * * @throws UnsupportedOperationException */
0
import org.apache.accumulo.core.util.HostAndPort; transport = TSSLTransportFactory.getClientSocket(address.getHost(), address.getPort(), timeout); transport = createClient(wrappingSslSockFactory, address.getHost(), address.getPort(), timeout); log.trace("Creating SASL connection to {}:{}", address.getHost(), address.getPort()); final String hostname = InetAddress.getByName(address.getHost()).getCanonicalHostName(); transport = new TSocket(address.getHost(), address.getPort());
1
package org.apache.http.impl.client;
0
import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;
0
public SmbFileSystem( final FileName rootName ) super( rootName, null );
0
@SuppressWarnings("unchecked")
0
import cz.seznam.euphoria.spark.accumulators.SparkAccumulatorFactory; private final SparkAccumulatorFactory accumulatorFactory; SparkAccumulatorFactory accumulatorFactory, public SparkAccumulatorFactory getAccumulatorFactory() {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbcp/doc/ManualPoolingDataSourceExample.java,v 1.2 2003/08/11 14:37:12 dirkv Exp $ * $Revision: 1.2 $ * $Date: 2003/08/11 14:37:12 $ // First we load the underlying JDBC driver. // You need this if you don't use the jdbc.drivers // system property. // System.out.println("Loading underlying JDBC driver."); Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Done."); // // Then, we set up the PoolingDataSource.
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.ambari.logsearch.health; import org.apache.ambari.logsearch.dao.AuditSolrDao; import org.springframework.data.solr.core.SolrTemplate; import javax.inject.Inject; import javax.inject.Named; @Named public class SolrAuditLogsHealthIndicator extends AbstractSolrHealthIndicator { @Inject private AuditSolrDao auditSolrDao; @Override public SolrTemplate getSolrTemplate() { return auditSolrDao.getSolrTemplate(); } }
0
// Before we try anything, check to see if we can read users/root out of Zookeeper, as it should be guaranteed to exist and ACLed // This is to ensure we have the right secret before we can muck around with anything ZooReaderWriter.validateSecret();
0
package org.apache.cocoon.portal.services; import org.apache.cocoon.portal.LayoutException;
0
import org.apache.commons.validator.routines.checkdigit.CheckDigit; import org.apache.commons.validator.routines.checkdigit.LuhnCheckDigit; import org.apache.commons.validator.util.Flags; * Luhn checkdigit validator for the card numbers. */ private static final CheckDigit LUHN_VALIDATOR = LuhnCheckDigit.INSTANCE; /** if (!LUHN_VALIDATOR.isValid(card)) {
0
import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; PropertiesConfiguration configProperties = new PropertiesConfiguration("metadata-buildinfo.properties"); response.put("Version", configProperties.getString("build.version", "UNKNOWN")); response.put("Name", configProperties.getString("project.name", "metadata-governance")); response.put("Description", configProperties.getString("project.description", "Metadata Management and Data Governance Platform over Hadoop")); // response.put("Hadoop", VersionInfo.getVersion() + "-r" + VersionInfo.getRevision()); } catch (JSONException | ConfigurationException e) {
0
private final ViewContext context; private final AmbariApi ambariApi; this.ambariApi = new AmbariApi(context); String rmUrl = getRMUrl(); RMRequestsDelegate delegate = new RMRequestsDelegateImpl(context, rmUrl); return ambariApi.getServices().getRMUrl();
0
import org.apache.cocoon.portal.om.CopletAdapter;
0
/** * Create a {@code TransformHierarchy} containing a root node. */
0
if (child == null) { } else if (child == target) { } else { } if (parent != null && threadable == null) { } if (threadable != null) { } if (threadable != null) { } rest = (rest == null ? null : rest.next)) { } for (kid = child; kid != null; kid = kid.next) { }
1
rethrow = checkConsistency(session, allCandidates, currentFaultyResources, hosts, false); Map<Resource, Resource> hosts, boolean dynamic) allCandidates, dynamic, resourcePkgMap, resultCache); rethrow = checkConsistency( session, allCandidates, new OpenHashMap<Resource, ResolutionError>(resourcePkgMap.size()), Collections.singletonMap(host, allCandidates.getWrappedHost(host)), true);
0
if (!isVisible) return null; if (shape == null) return null; if (primitiveBounds != null) return primitiveBounds; if (shapePainter == null) primitiveBounds = shape.getBounds2D(); else primitiveBounds = shapePainter.getPaintedBounds2D(); // Check If we should halt early. if (HaltingThread.hasBeenHalted()) { // The Thread has been halted. // Invalidate any cached values and proceed (this // sets primitiveBounds to null). invalidateGeometryCache();
0
package org.apache.felix.framework.installer.artifact; import org.apache.felix.framework.installer.Status; import org.apache.felix.framework.installer.StringProperty;
1
import org.apache.batik.util.CSSConstants;
0
return parentNode; parentNode = v; previousSibling = v; return previousSibling; nextSibling = v; return nextSibling;
1
* A {@link org.apache.cocoon.woody.datatype.Datatype Datatype} implementation for
0
if (orFields) return matches(rowMatcher, key.getRowData()) || matches(colfMatcher, key.getColumnFamilyData()) || matches(colqMatcher, key.getColumnQualifierData()) || matches(valueMatcher, value.get(), 0, value.get().length); if (options.containsKey(ROW_REGEX)) Pattern.compile(options.get(ROW_REGEX)).matcher(""); if (options.containsKey(COLF_REGEX)) Pattern.compile(options.get(COLF_REGEX)).matcher(""); if (options.containsKey(COLQ_REGEX)) Pattern.compile(options.get(COLQ_REGEX)).matcher(""); if (options.containsKey(VALUE_REGEX)) Pattern.compile(options.get(VALUE_REGEX)).matcher("");
1
* @version $Revision$
1
StandaloneAccumuloCluster standaloneCluster = new StandaloneAccumuloCluster(cluster.getConnectionInfo(), conf.getTmpDirectory(), conf.getUsers()); if (saslEnabled()) { checkState(initialized); return getCluster().getConnectionInfo(); } public static boolean saslEnabled() { if (initialized) { return getConnectionInfo().saslEnabled(); } return false;
0
return Arrays.asList("-Xdebug", String.format("-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%d", port));
0
private static final String CLUSTER_HOST_INFO = "cluster_host_info"; Stage s = StageUtils.getATestStage(1, 1, "h1", CLUSTER_HOST_INFO); Stage stage = new Stage(1, "/logDir", "c1", "My Context", CLUSTER_HOST_INFO); assertEquals(CLUSTER_HOST_INFO, stage.getClusterHostInfo());
0
import org.apache.http.HttpClientConnection; import org.apache.http.conn.ConnectionRequest; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; private PoolingHttpClientConnectionManager mgr; this.mgr = new PoolingHttpClientConnectionManager(); ConnectionRequest connreq = this.mgr.requestConnection(new HttpRoute(target), null); connreq.get(250, TimeUnit.MILLISECONDS); HttpClientConnection conn = connreq.get(250, TimeUnit.MILLISECONDS); this.mgr.releaseConnection(conn, null, -1, null); ConnectionRequest connreq = this.mgr.requestConnection(new HttpRoute(target), null); connreq.get(250, TimeUnit.MILLISECONDS); HttpClientConnection conn = connreq.get(250, TimeUnit.MILLISECONDS); this.mgr.releaseConnection(conn, null, -1, null); ConnectionRequest connreq = this.mgr.requestConnection(new HttpRoute(target), null); connreq.get(250, TimeUnit.MILLISECONDS); HttpClientConnection conn = connreq.get(250, TimeUnit.MILLISECONDS); this.mgr.releaseConnection(conn, null, -1, null); ConnectionRequest connreq = this.mgr.requestConnection(new HttpRoute(target), null); connreq.get(250, TimeUnit.MILLISECONDS); HttpClientConnection conn = connreq.get(250, TimeUnit.MILLISECONDS); this.mgr.releaseConnection(conn, null, -1, null);
0
import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver;
0
/** * Copyright 2016-2017 Seznam.cz, a.s. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cz.seznam.euphoria.operator.test.accumulators; import java.time.Duration; import java.util.Map; public interface SnapshotProvider { Map<String, Long> getCounterSnapshots(); Map<String, Map<Long, Integer>> getHistogramSnapshots(); Map<String, Map<Duration, Integer>> getTimerSnapshots(); }
0
@Override @Override @Override @Override @Override @Override @Override @Override @Override
1
* @version $Revision$
1
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
@Deprecated @Deprecated @Deprecated
0
public final CloseFuture close(boolean immediately) { public final boolean isClosed() { public final boolean isClosing() {
0
package org.apache.bcel.util;
1
if (!StringUtils.equals(property.getValue(),clusterConfigProperties.get(property.getKey()))) {
0
import org.apache.commons.codec.RequiredCharsetNames; qpcodec.encode(ru_msg, RequiredCharsetNames.UTF_8) assertEquals("Gr=C3=BCezi_z=C3=A4m=C3=A4", qpcodec.encode(ch_msg, RequiredCharsetNames.UTF_8)); assertEquals(ru_msg, qpcodec.decode(qpcodec.encode(ru_msg, RequiredCharsetNames.UTF_8), RequiredCharsetNames.UTF_8)); assertEquals(ch_msg, qpcodec.decode(qpcodec.encode(ch_msg, RequiredCharsetNames.UTF_8), RequiredCharsetNames.UTF_8));
0
import java.util.HashSet; import java.util.Set; * @version $Revision: 1.2 $ $Date: 2002/11/23 00:14:45 $ * @todo Extract subclass that overlays the children private FileObject file; private final Set children = new HashSet(); public void attachChild( final String baseName ) throws FileSystemException { if ( children.add( baseName ) ) { detach(); } } public void setFile( final FileObject file ) throws FileSystemException { this.file = file; children.clear(); detach(); } if ( file != null ) if ( file.exists() ) { return file.getType(); } else if ( children.size() > 0 ) return FileType.FOLDER; return null; if ( file != null ) { return file.isReadable(); } else { return true; } if ( file != null ) { return file.isWriteable(); } else { return false; } if ( file != null ) { final FileObject[] children = file.getChildren(); final String[] childNames = new String[ children.length ]; for ( int i = 0; i < children.length; i++ ) { childNames[ i ] = children[ i ].getName().getBaseName(); } return childNames; } else return (String[])children.toArray( new String[ children.size() ] );
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/list/CursorableLinkedList.java,v 1.2 2003/12/29 00:38:08 scolebourne Exp $ * @version $Revision: 1.2 $ $Date: 2003/12/29 00:38:08 $ if (next == parent.header) { nextIndex = parent.size(); Node temp = parent.header.next; ((CursorableLinkedList) parent).unregisterCursor(this);
0
protected StringBuffer cdataBuffer; cdataBuffer = null; if (cdataBuffer != null) cdataBuffer.append(ch, start, length); else { String data = new String(ch, start, length); if (currentNode == null) { preInfo.add(new TextInfo(data)); } else { currentNode.appendChild(document.createTextNode(data)); } cdataBuffer = new StringBuffer(); String data = cdataBuffer.toString(); if (currentNode == null) { preInfo.add(new CDataInfo(data)); } else { currentNode.appendChild(document.createCDATASection(data)); } cdataBuffer = null;
0
if (!getCombinedState().isAcceptingInputs())
0
* @version CVS $Id$
0
if (!(type.getType() instanceof Class)) { reportError(context, "Cannot determine type from generic %s due to erasure", type); return; } private static Field getField(Class<?> originalClazz, String name) { Class<?> clazz = originalClazz; throw new IllegalArgumentException("Unable to get field " + name + " from " + originalClazz);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/ValidatorResults.java,v 1.11 2004/04/08 23:05:39 dgraham Exp $ * $Revision: 1.11 $ * $Date: 2004/04/08 23:05:39 $
0
import org.apache.accumulo.server.util.ReplicationTableUtil; ReplicationTableUtil.updateReplication(SystemCredentials.get(), extent, unusedWalLogs, StatusUtil.fileClosed()); ReplicationTableUtil.updateReplication(SystemCredentials.get(), extent, logEntry.logSet, StatusUtil.fileClosed());
0
Assert.assertThat(extractWordsFn.processBundle(" some input words "), Assert.assertThat(extractWordsFn.processBundle(" "), Assert.assertThat(extractWordsFn.processBundle(" some ", " input", " words"),
0
copy.setProperty("element3", "clonedValue"); assertEquals("value", conf.getString("element3")); conf.setProperty("element3[@name]", "originalFoo"); assertEquals("foo", copy.getString("element3[@name]")); } public void testSubset() throws ConfigurationException { conf = new XMLConfiguration(); conf.load(new File("conf/testHierarchicalXMLConfiguration.xml")); conf.subset("tables.table(0)"); if(testSaveConf.exists()) { assertTrue(testSaveConf.delete()); } conf.save(testSaveConf); conf = new XMLConfiguration(testSaveConf); assertEquals("users", conf.getString("tables.table(0).name"));
0
client.update(tinfo, credentials.toThrift(instance), entry.getKey().toThrift(), entry.getValue().get(0).toThrift(), DurabilityImpl.toThrift(durability)); long usid = client.startUpdate(tinfo, credentials.toThrift(instance), DurabilityImpl.toThrift(durability));
1
// private ComponentContext and implementation instances final ComponentContext serviceContext; serviceContext = ( ComponentContext ) serviceContexts.remove( service ); disposeImplementationObject( service, serviceContext, ComponentConstants.DEACTIVATION_REASON_DISPOSED ); // if this was the last use of the component, go back to REGISTERED state if ( serviceContexts.isEmpty() && getState() == STATE_ACTIVE ) changeState( Registered.getInstance() ); unsetDependencyMap();
0
import org.apache.batik.gvt.filter.Mask; Mask mask = CSSUtilities.convertMask(element, node, ctx); node.setMask(mask);
0
* in DirectRunner and on SparkPipelineRunner, with the mapped dataflow-to-spark
0
import org.apache.beam.runners.core.construction.BeamUrns; environment .getUrn() .equals(BeamUrns.getUrn(RunnerApi.StandardEnvironments.Environments.DOCKER)), final RunnerApi.DockerPayload dockerPayload = RunnerApi.DockerPayload.parseFrom(environment.getPayload());
0
final Collection<?> param = (Collection<?>) params.getParameter( final boolean singleHeader = params.getBooleanParameter(
0
"--string=baz", "--otherString=quux").as(TestOptions.class);
0
if (!hasNext) throw new NoSuchElementException(); if (topKey == null) return super.getTopKey(); if (topKey == null) return super.getTopValue(); if (workKey.isDeleted()) return;
1
package org.apache.cocoon.template.v2.script;
0
package org.apache.http.conn;
0
* @param baseURI Element element, String baseURI, StorageResolver storage DSAKeyValue dsaKeyValue = new DSAKeyValue(dsaKeyElement, baseURI); Element element, String baseURI, StorageResolver storage Element element, String baseURI, StorageResolver storage
0
this.tableName = Tables.getTableName(instance, Table.ID.of(activeScan.tableId));
1
private static final char[] US_ENGLISH_MAPPING = US_ENGLISH_MAPPING_STRING.toCharArray();
0
* @author <a href="mailto:deweese@apache.org">l449433</a> // Wait for Update Manager to Start. while (!updateManager.isRunning());
1
import org.apache.http.Header; private static final String EXPECT_DIRECTIVE = "Expect"; private static final String EXPECT_CONTINUE = "100-Continue"; public boolean expectContinue() { Header expect = getFirstHeader(EXPECT_DIRECTIVE); return expect != null && EXPECT_CONTINUE.equalsIgnoreCase(expect.getValue()); }
0
* @return a {@code String} variant key
0
* 1521</a> and allows a character set to be specified. * <a href="http://www.ietf.org/rfc/rfc1522.txt">RFC 1522</a> describes techniques to allow the encoding of non-ASCII * @see <a href="http://www.ietf.org/rfc/rfc1522.txt">MIME (Multipurpose Internet Mail Extensions) Part Two: Message * Header Extensions for Non-ASCII Text</a> * @version $Id: BCodec.java,v 1.4 2004/04/13 22:02:37 ggregory Exp $ * encoding names</a>
0
package org.apache.hc.client5.testing.sync;
0
* <code>ExceptionConverter</code> converts WebDAV exceptions into FileSystemExceptions. * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a> public final class ExceptionConverter }
0
protected Object clearTreeInternal(String key)
0
import org.apache.cocoon.components.sax.XMLByteStreamInterpreter; XMLByteStreamInterpreter deserializer = new XMLByteStreamInterpreter();
0
* The bit array representing the first character of an XML name. */ * The bit array representing a character compositing an XML name. */
0
import java.util.Locale; String nameLower = name.toLowerCase(Locale.ENGLISH);
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.beam.dsls.sql.rel; import org.apache.beam.sdk.Pipeline; import org.apache.calcite.rel.RelNode; import org.beam.dsls.sql.planner.BeamPipelineCreator; /** * A new method {@link #buildBeamPipeline(BeamPipelineCreator)} is added, it's * called by {@link BeamPipelineCreator}. * */ public interface BeamRelNode extends RelNode { /** * A {@link BeamRelNode} is a recursive structure, the * {@link BeamPipelineCreator} visits it with a DFS(Depth-First-Search) * algorithm. * */ Pipeline buildBeamPipeline(BeamPipelineCreator planCreator) throws Exception; }
0
this.createDummyBlueprint("MyDummyBlueprint", "0", "MyDummySiteBlueprint", "0"); } public void createDummyBlueprint (String name, String revision, String siteName, String siteVersion) { bp.setName(name); bp.setParentName(siteName); bp.setRevision(revision); bp.setParentRevision(siteVersion); try { addBlueprint (bp); }catch (Exception e) { e.printStackTrace(); } /* ConcurrentHashMap<Integer, Blueprint> x = new ConcurrentHashMap<Integer, Blueprint>(); */ public Blueprint getBlueprint(String blueprintName, int revision) throws Exception { if (!this.blueprints.containsKey(blueprintName) || !this.blueprints.get(blueprintName).containsKey(revision)) {
0
import static org.junit.Assert.*; assertEquals(8, moved); assertEquals(48, moved);
0
import org.apache.zookeeper.Watcher.Event.EventType; import org.apache.zookeeper.Watcher.Event.KeeperState; public Set<Watcher> materialize(Watcher.Event.KeeperState state, Watcher.Event.EventType type, String path);
0
import org.apache.accumulo.core.client.impl.Tables; TableConfiguration tblConf = tabletServer.getTableConfiguration(extent); if (null == tblConf) { Tables.clearCache(tabletServer.getInstance()); tblConf = tabletServer.getTableConfiguration(extent); if (null == tblConf) { // Not guaranteed to be non-null, but should be. A failed load will be re-assigned though.. log.warn("Could not get table configuration for " + extent.getTableId().toString()); } } this.tableConfiguration = tblConf; rawLogEntries, rawDatafiles), ReplicationConfigurationUtil.isEnabled(extent, this.tableConfiguration));
0
import org.apache.accumulo.core.client.ClientConfiguration;
0
import java.util.Iterator; * @version $Id: TestBaseConfiguration.java,v 1.8 2004/03/09 15:34:02 epugh Exp $ eprop.setProperty("property.string", "hello"); Iterator it = subEprop.getKeys(); it.next(); assertFalse(it.hasNext()); subEprop = eprop.subset("prop."); it = subEprop.getKeys(); assertFalse(it.hasNext());
0
import java.util.concurrent.atomic.AtomicLong; private static AtomicLong s_nextId = new AtomicLong(System.nanoTime()); this("" + Id.nextNegativeLong(), 0, typeName); private static long nextNegativeLong() { long ret = s_nextId.getAndDecrement(); if (ret > 0) { ret *= -1; } else if (ret == 0) { ret = Long.MIN_VALUE; } return ret; }
0