Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
* @version $Id: FTPFileList.java,v 1.3 2002/05/03 14:52:29 brekke Exp $ * @return vector containing all the raw input lines returned from the FTP * server * create an iterator over this list using the parser with which this list * was initally created * create an iterator over this list using the supplied parser * * @param parser The user-supplied parser with which the list is to be * iterated, may be different from this list's default parser.
0
private static final Map<Integer,Value> resultsByWorker = new ConcurrentHashMap<>(); Set<Long> scanIds = new HashSet<>(); SortedSet<Text> splits = new TreeSet<>();
0
import static org.junit.jupiter.api.Assertions.assertEquals; @org.junit.jupiter.api.Test
0
package org.apache.commons.net;
0
log.debug("Received SSH_FXP_INIT (version={})", id); // see https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt - section 4 - Protocol Initialization if (length < 5) { // we don't care about extensions throw new IllegalArgumentException("Incomplete SSH_FXP_INIT data: length=" + length);
0
count = Integer.valueOf(0);
0
zipFile.getInputStream(zipFile.getEntry("appConfig-default.json")), zipFile.getInputStream(zipFile.getEntry("resources-default.json")),
0
import org.apache.accumulo.core.util.shell.commands.PingCommand; Command[] debuggingCommands = {new ClasspathCommand(), new DebugCommand(), new ListScansCommand(), new ListCompactionsCommand(), new TraceCommand(), new PingCommand()};
0
* Closes the given filesystem. * <p> * If you use VFS as singleton it is VERY dangerous to call this method. *
0
public static <T> Read.Bounded<T> readFromSource(
0
* @param attrName attribute name. * @param attrValue attribute value. AtlasSearchResult searchUsingBasicQuery(String query, String type, String classification, String attrName, String attrValue, int limit, int offset) throws AtlasBaseException;
0
import org.junit.Rule; import org.junit.rules.ExpectedException; @Rule public ExpectedException thrown = ExpectedException.none(); @Test thrown.expect(UnrecoverableKeyException.class); @Test thrown.expect(SSLHandshakeException.class); @Test thrown.expect(IOException.class); @Test thrown.expect(IOException.class); final double javaVersion = Double.parseDouble(System.getProperty("java.specification.version")); final boolean isWindows = System.getProperty("os.name").contains("Windows"); if (isWindows && javaVersion < 1.8) { thrown.expect(IOException.class); } else { thrown.expect(SSLHandshakeException.class); } clientSocket.startHandshake();
0
import org.apache.accumulo.core.client.Durability; String durability = null; case DEFAULT: log.warn("unexpected durability " + logWork.durability, new Throwable()); durability = logWork.durability.toString(); durability = logWork.durability.toString(); if (durabilityMethod != null) { log.debug("durability method " + durability); } else { log.debug("skipping flush/sync"); } log.debug("Durability for " + tabletMutations.getDurability() + " (ordinal) " + tabletMutations.getDurability().ordinal() + " durability " + durability + " (ordinal) " + durability.ordinal());
1
* Implementation of {@link CredentialsProvider} backed by standard * JRE {@link Authenticator}.
0
String[] tableNames = getUniqueNames(2);
0
import org.apache.ambari.logfeeder.input.cache.LRUCache; import org.apache.ambari.logfeeder.util.DateUtil; private OutputLineFilter outputLineFilter = new OutputLineFilter(); if (FilterLogData.INSTANCE.isAllowed(jsonObj, inputMarker) && !outputLineFilter.apply(jsonObj, inputMarker.input)) {
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
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * 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 org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements; import org.apache.cocoon.components.elementprocessor.types.NumericConverter; import org.apache.cocoon.components.elementprocessor.types.NumericResult; import java.io.IOException; /** * No-op implementation of ElementProcessor to handle the "MaxCol" tag * * This element contains the maximum number of columns in the * containing sheet. The value is contained in the data. * * @author Marc Johnson (marc_johnson27591@hotmail.com) * @version $Id$ */ public class EPMaxCol extends BaseElementProcessor { private NumericResult _max_col; /** * constructor */ public EPMaxCol() { super(null); _max_col = null; } /** * get the maximum column for the containing sheet * @return maximum column number * @exception IOException if the data is malformed */ public int getMaxCol() throws IOException { if (_max_col == null) { _max_col = NumericConverter.extractPositiveInteger(getData()); } return _max_col.intValue(); } } // end public class EPMaxCol
0
assertEquals("Must have ten sessions. Failure indicates a synchronization" + " block within the sweep mechanism", 10, sessionsFound);
0
@Override
0
* <b>DOM</b>: Implements {@link SVGTextPositioningElement#getX()}. * <b>DOM</b>: Implements {@link SVGTextPositioningElement#getY()}. * <b>DOM</b>: Implements {@link SVGTextPositioningElement#getDx()}. * <b>DOM</b>: Implements {@link SVGTextPositioningElement#getDy()}. * <b>DOM</b>: Implements {@link SVGTextPositioningElement#getRotate()}.
0
/** Interface of Samza translator for BEAM {@link PTransform}. */ void translate(T transform, TransformHierarchy.Node node, TranslationContext ctx);
1
final Object[][] rows = new Object[][] { { null } final SqlNullCheckedResultSet ncrs = new SqlNullCheckedResultSet(rs);
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.server.serveraction.kerberos; /** * KerberosConfigDataFile declares the default data file name and the common record column names * for the Kerberos configuration data files. */ public class KerberosConfigDataFile { public static final String DATA_FILE_NAME = "configs.dat"; public static final String CONFIGURATION_TYPE = "config"; public static final String KEY = "key"; public static final String VALUE = "value"; }
0
* The constructor for a FTPFileEntryParserImpl object.
0
StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(),
0
import org.apache.accumulo.core.security.TableNamespacePermission; public boolean hasTableNamespacePermission(final String principal, final String tableNamespace, final TableNamespacePermission perm) throws AccumuloException, AccumuloSecurityException { ArgumentChecker.notNull(principal, tableNamespace, perm); return execute(new ClientExecReturn<Boolean,ClientService.Client>() { @Override public Boolean execute(ClientService.Client client) throws Exception { return client.hasTableNamespacePermission(Tracer.traceInfo(), credentials.toThrift(instance), principal, tableNamespace, perm.getId()); } }); } @Override public void grantTableNamespacePermission(final String principal, final String tableNamespace, final TableNamespacePermission permission) throws AccumuloException, AccumuloSecurityException { ArgumentChecker.notNull(principal, tableNamespace, permission); execute(new ClientExec<ClientService.Client>() { @Override public void execute(ClientService.Client client) throws Exception { client.grantTableNamespacePermission(Tracer.traceInfo(), credentials.toThrift(instance), principal, tableNamespace, permission.getId()); } }); } @Override @Override public void revokeTableNamespacePermission(final String principal, final String tableNamespace, final TableNamespacePermission permission) throws AccumuloException, AccumuloSecurityException { ArgumentChecker.notNull(principal, tableNamespace, permission); execute(new ClientExec<ClientService.Client>() { @Override public void execute(ClientService.Client client) throws Exception { client.revokeTableNamespacePermission(Tracer.traceInfo(), credentials.toThrift(instance), principal, tableNamespace, permission.getId()); } }); }
0
* <p> * </p>
0
/** {@inheritDoc} */
0
* Default : true boolean architecture() default true; * default: true
0
import net.jcip.annotations.NotThreadSafe; @NotThreadSafe // RequestWrapper is @NotThreadSafe protected final RequestWrapper request; // @NotThreadSafe protected final HttpRoute route; // @Immutable
0
package org.apache.aurora.scheduler.async; import org.apache.aurora.scheduler.async.TaskGroups.GroupKey;
0
this.listener = definition.getProcessingPhaseListener(); this.phase = ProcessingPhase.PROCESSING_INITIALIZE;
0
import org.apache.http.params.SimpleParamStack; req.setParams(new SimpleParamStack(req.getParams(), params)); rsp.setParams(new SimpleParamStack(rsp.getParams(), params));
0
public FileSKVIterator openReader(FileRef ref) throws IOException {
0
factory = new ConfigurationFactory(); File nonExistingFile = new File("conf/nonexisting.xml"); factory.setConfigurationURL(nonExistingFile.toURL()); try { factory.getConfiguration(); fail("Could load non existing file!"); } catch(ConfigurationException cex) { //ok } public void testBasePath() throws Exception { assertEquals(".", factory.getBasePath()); factory.setConfigurationFileName(testDigesterFile.getAbsolutePath()); // if no specific base path has been set, the base is determined // from the file name assertEquals(testDigesterFile.getParentFile().getAbsolutePath(), factory.getBasePath()); String homeDir = System.getProperty("user.home"); factory = new ConfigurationFactory(); factory.setBasePath(homeDir); factory.setConfigurationFileName(testDigesterFile.getAbsolutePath()); // if a base path was set, the file name does not play a role assertEquals(homeDir, factory.getBasePath()); factory = new ConfigurationFactory(testDigesterFile.getAbsolutePath()); assertEquals(testDigesterFile.getParentFile().getAbsolutePath(), factory.getBasePath()); factory.setBasePath(homeDir); assertEquals(homeDir, factory.getBasePath()); factory = new ConfigurationFactory(); factory.setConfigurationURL(testDigesterFile.toURL()); assertEquals(testDigesterFile.toURL().toString(), factory.getBasePath()); }
0
import org.apache.http.HttpHost; String hostname; if (remoteAddress instanceof HttpInetSocketAddress) { hostname = ((HttpInetSocketAddress) remoteAddress).getHost().getHostName(); } else { hostname = remoteAddress.getHostName(); } sslsock = (SSLSocket) this.socketfactory.createSocket(sock, hostname, remoteAddress.getPort(), true); InetSocketAddress remote = new HttpInetSocketAddress(new HttpHost(host, port), remoteAddress, port);
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
import static org.junit.Assert.fail; // Test that we can't write to a closed stream. try { consumer.accept( valueInGlobalWindow( new byte[BeamFnDataBufferingOutboundObserver.DEFAULT_BUFFER_LIMIT_BYTES - 50])); fail("Writing after close should be prohibited."); } catch (IllegalStateException exn) { // expected } // Test that we can't close a stream twice. try { consumer.close(); fail("Closing twice should be prohibited."); } catch (IllegalStateException exn) { // expected }
0
if (contentproducer == null) {
0
if (closeConn) { } if (closeConn) { }
0
Buffer modes = new ByteArrayBuffer(GenericUtils.size(ptyModes) * (1 + (Integer.SIZE / Byte.SIZE)) + Long.SIZE, false);
0
if (request != null) { String method = request.getRequestLine().getMethod(); if (HEAD_METHOD.equalsIgnoreCase(method)) { return false; }
0
public static <K, V> OrderedBidiMap<K, V> unmodifiableOrderedBidiMap( final OrderedBidiMap<? extends K, ? extends V> map) { @SuppressWarnings("unchecked") // safe to upcast final OrderedBidiMap<K, V> tmpMap = (OrderedBidiMap<K, V>) map; return tmpMap; @SuppressWarnings("unchecked") // safe to upcast private UnmodifiableOrderedBidiMap(final OrderedBidiMap<? extends K, ? extends V> map) { super((OrderedBidiMap<K, V>) map);
0
public TabletLocations lookupTablet(TabletLocation src, Text row, Text stopRow, TabletLocator parent, TCredentials credentials) throws AccumuloSecurityException { }
0
org.apache.commons.logging.LogFactory.getLog(JCEMapper.class);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/util/ValueUtils.java,v 1.8 2002/10/12 20:57:44 dmitri Exp $ * $Revision: 1.8 $ * $Date: 2002/10/12 20:57:44 $ * @version $Revision: 1.8 $ $Date: 2002/10/12 20:57:44 $ Object collection = getValue(bean, propertyDescriptor); if (isCollection(collection)){ setValue(collection, index, value); } else if (index == 0){ setValue(bean, propertyDescriptor, value); } else { throw new RuntimeException("Not a collection: " + propertyDescriptor.getName()); }
0
import static org.apache.beam.sdk.extensions.sql.jdbc.BeamSqlLineTestingUtils.buildArgs; import static org.apache.beam.sdk.extensions.sql.jdbc.BeamSqlLineTestingUtils.toLines;
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.
0
m_isValid = true; m_isValid = false;
0
* @version CVS $Id: WidgetReplacingPipe.java,v 1.19 2003/12/23 08:46:17 mpo Exp $ protected WoodyPipelineConfig pipeContext; public void init(Widget newContextWidget, WoodyPipelineConfig newPipeContext) {
0
return new IntAttributeStore(i); return new LongAttributeStore(i); return new FloatAttributeStore(i); return new DoubleAttributeStore(i); return new BigIntStore(i); return new BigDecimalStore(i); return new DateStore(i); return new StringStore(i); return new StringStore(i); list.size(pos+1); nullList.size(pos+1); list.size(pos+1); nullList.size(pos+1); list.size(pos+1); nullList.size(pos+1); list.size(pos+1); nullList.size(pos+1); list.size(pos+1); nullList.size(pos+1); list.size(pos+1); nullList.size(pos+1); list.size(pos+1); nullList.size(pos+1); while (list.size() < pos + 1) { list.add((T)null); } nullList.size(pos+1);
0
import java.util.TimeZone; public static ThreadLocal<DateFormat> dateFormat = new ThreadLocal() { @Override public DateFormat initialValue() { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat; } }; return dateFormat.get();
0
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; private static final Log LOG = LogFactory.getLog(ClientParamsStack.class); if (LOG.isDebugEnabled()) { LOG.debug("'" + name + "': " + result); }
0
/* * $Id$ * 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. */
0
super(org.apache.commons.bcel6.Const.IFLE, target);
0
* * has 0700 access and the file 0600. <B>Note:</B> for <I>Windows</I> it * does not check these permissions public DefaultAuthorizedKeysAuthenticator(Path path, boolean strict, LinkOption... options) { public DefaultAuthorizedKeysAuthenticator(String user, Path path, boolean strict, LinkOption... options) { return username.equals(expected); * @param path The {@link Path} to be validated * @param perms The current {@link PosixFilePermission}s
1
import org.apache.beam.sdk.values.WindowingStrategy;
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables.getOnlyElement;
0
Copyright 2000-2003,2005 The Apache Software Foundation import org.apache.batik.dom.events.EventSupport; /** * Creates an EventSupport object for a given node. */ public EventSupport createEventSupport(AbstractNode n) { return new EventSupport(n); }
1
public static <E> TransformedBuffer<E> transformingBuffer(final Buffer<E> buffer, final Transformer<? super E, ? extends E> transformer) { public static <E> TransformedBuffer<E> transformedBuffer(final Buffer<E> buffer, final Transformer<? super E, ? extends E> transformer) { final for (final E value : values) { protected TransformedBuffer(final Buffer<E> buffer, final Transformer<? super E, ? extends E> transformer) {
0
public void accept( final Visitor v ) {
0
FileSKVIterator reader = FileOperations.getInstance().openReader(path.toString(), true, ns, ns.getConf(), null, conf);
1
import org.apache.atlas.RequestContextV1; Map<String, List<AtlasClassification>> addedPropagations = RequestContextV1.get().getAddedPropagations(); Map<String, List<AtlasClassification>> removedPropagations = RequestContextV1.get().getRemovedPropagations(); if (addedPropagations.containsKey(entity.getGuid())) { notifyEntityEvents(Collections.singletonList(entity), CLASSIFICATION_ADD); } else if (!removedPropagations.containsKey(entity.getGuid())) { notifyEntityEvents(Collections.singletonList(entity), CLASSIFICATION_UPDATE); }
0
import java.util.Collections; import java.util.Set; import javax.management.JMException; import javax.security.auth.login.AppConfigurationEntry; import org.apache.zookeeper.Login; return cnxns.size(); // Connection set is relied on heavily by four letter commands // Construct a ConcurrentHashSet using a ConcurrentHashMap protected final Set<ServerCnxn> cnxns = Collections.newSetFromMap( new ConcurrentHashMap<ServerCnxn, Boolean>());
0
import org.apache.accumulo.core.security.thrift.TCredentials; public TabletLocation locateTablet(Text row, boolean skipRow, boolean retry, TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { public void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations> binnedMutations, List<Mutation> failures, TCredentials credentials) throws AccumuloException, public List<Range> binRanges(List<Range> ranges, Map<String,Map<KeyExtent,List<Range>>> binnedRanges, TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TCredentials credentials = null; List<TabletLocation> overlaps = BulkImporter.findOverlappingTablets(acuConf, fs, locator, new Path(file), credentials); "b")), credentials);
0
@Override public void visit(State state, Properties props) throws Exception { String indexTableName = (String) state.get("indexTableName"); Collection<Text> splits = state.getConnector().tableOperations().getSplits(indexTableName); SortedSet<Text> splitSet = new TreeSet<Text>(splits); log.debug("merging " + indexTableName); state.getConnector().tableOperations().merge(indexTableName, null, null); org.apache.accumulo.core.util.Merge merge = new org.apache.accumulo.core.util.Merge(); merge.mergomatic(state.getConnector(), indexTableName, null, null, 256 * 1024 * 1024, true); splits = state.getConnector().tableOperations().getSplits(indexTableName); if (splits.size() > splitSet.size()) { // throw an excpetion so that test will die an no further changes to table will occur... // this way table is left as is for debugging. throw new Exception("There are more tablets after a merge: " + splits.size() + " was " + splitSet.size()); }
1
public void testUnknownHost() throws Exception { session.close();
0
System.err.println("Expected to find HTML info for "+ asciiTld); while (line.matches("^\\s*$")) { // extra blank lines introduced line = br.readLine(); } // System.out.println("Ignored: " + typ + " " + dom + " " +com); // System.out.println("Storing: " + typ + " " + dom + " " +com); } else { System.err.println("Unexpected type: " + line); final int HOUR = 60*60*1000; // an hour in ms final long modTime; // For testing purposes, don't download files more than once an hour if (f.canRead()) { modTime = f.lastModified(); if (modTime > System.currentTimeMillis()-HOUR) { } else { modTime = 0; if (modTime > 0) {
0
if (value instanceof PCollectionView) { views.add((PCollectionView<?>) value); } if (!producers.containsKey(value)) { producers.put(value, appliedTransform); }
0
List<Referenceable> partKeys = getColumns(hiveTable.getPartitionKeys());; tableRef.set("partitionKeys", partKeys);
0
WebContinuation kont = continuationsHolder.get(id); WebContinuation wk = continuationsHolder.get(idsIter.next());
0
import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.fail;
0
* * @deprecated since 2.0. This class maintained for backwards compatibility please do not remove. * New users should use org.apache.accumulo.hadoop.mapred.AccumuloOutputFormat @Deprecated
0
Mutation m = new Mutation(new Text(ReplicationSection.getRowPrefix() + file));
0
* * @param mode The default running mode. * @return The current running mode. * Currently this method does not check anything. All modes (apart from null) * are valid. * @param mode Check if the mode is a valid mode. if ( mode == null ) { throw new IllegalArgumentException("Running mode can't be null."); }
0
this.log.debug("Garbage in response: " + this.lineBuf.toString());
0
import org.apache.felix.service.command.CommandSession; import org.apache.felix.service.command.Function;
0
Provider<ConfigHelper> m_configHelperProvider; ServiceConfigDAO m_serviceConfigDAO;
0
// Next look for custom property providers Iterator i = s.getPropertyProviders().iterator(); while ( i.hasNext() ) { final String className = (String)i.next(); try { PropertyProvider provider = (PropertyProvider)ClassUtils.newInstance(className); s.fill(provider.getProperties()); } catch (Exception ignore) { env.log("Unable to get property provider for class " + className, ignore); env.log("Continuing initialization."); } }
0
import java.text.MessageFormat; * Returns <code>true</code> if logging for the given level is enabled. */ public boolean isLogEnabled( int level ) { return m_logLevel >= level; } /** * Method to actually emit the log message. If the LogService is available, * the message will be logged through the LogService. Otherwise the message * is logged to stdout (or stderr in case of LOG_ERROR level messages), * * @param level The log level to log the message at * @param pattern The <code>java.text.MessageFormat</code> message format * string for preparing the message * @param arguments The format arguments for the <code>pattern</code> * string. * @param ex An optional <code>Throwable</code> whose stack trace is written, * or <code>null</code> to not log a stack trace. */ public void log( int level, String pattern, Object[] arguments, ComponentMetadata metadata, Throwable ex ) { if ( isLogEnabled( level ) ) { final String message = MessageFormat.format( pattern, arguments ); log( level, message, metadata, ex ); } } /** if ( isLogEnabled( level ) )
0
public static final String HS2_PROXY_USER = "hive.server2.proxy.user";
0
import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; @Mojo( name = "ant", requiresDependencyResolution = ResolutionScope.TEST )
0
import org.apache.felix.ipojo.runtime.core.services.Job; props.put("packageStaticInner", new PackageStaticNested().doSomething()); static class PackageStaticNested implements Job { private Map map = new HashMap(); public Map doSomething() { map.put("static", new Boolean(true)); map.put("staticint", new Integer(staticint)); return map; } }
0
import org.apache.beam.sdk.state.BagState; import org.apache.beam.sdk.state.CombiningState; import org.apache.beam.sdk.state.MapState; import org.apache.beam.sdk.state.ReadableState; import org.apache.beam.sdk.state.SetState; import org.apache.beam.sdk.state.State; import org.apache.beam.sdk.state.StateContext; import org.apache.beam.sdk.state.StateContexts; import org.apache.beam.sdk.state.ValueState; import org.apache.beam.sdk.state.WatermarkHoldState;
0
super(operands, SqlTypeName.DOUBLE);
0
glyphPositions = new Point2D.Float [numGlyphs+1]; glyphOutlines = new Shape [numGlyphs]; glyphVisualBounds = new Shape [numGlyphs]; glyphLogicalBounds = new Shape [numGlyphs]; glyphVisible = new boolean [numGlyphs]; glyphMetrics [i] = null; glyphVisualBounds [glyphIndex] = null; glyphOutlines [glyphIndex] = null; glyphMetrics [glyphIndex] = null; glyphVisualBounds [glyphIndex] = null; glyphOutlines [glyphIndex] = null; glyphMetrics [glyphIndex] = null; if (visible == glyphVisible[glyphIndex]) return; outline = null; visualBounds = null; glyphVisualBounds [glyphIndex] = null; glyphOutlines [glyphIndex] = null; glyphMetrics [glyphIndex] = null; } /** * Returns true if specified glyph will be rendered. */ public boolean isGlyphVisible(int glyphIndex) { return glyphVisible[glyphIndex];
0
return true; }
0
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.mockito.Matchers.eq; RemotePeerBean remotePeerBean = new RemotePeerBean(null, peer); @Test @SuppressWarnings("unchecked") public void testIsLeader() { long peerId = 7; QuorumPeer.QuorumServer quorumServerMock = mock(QuorumPeer.QuorumServer.class); when(quorumServerMock.getId()).thenReturn(peerId); QuorumPeer peerMock = mock(QuorumPeer.class); RemotePeerBean remotePeerBean = new RemotePeerBean(peerMock, quorumServerMock); when(peerMock.isLeader(eq(peerId))).thenReturn(true); assertTrue(remotePeerBean.isLeader()); when(peerMock.isLeader(eq(peerId))).thenReturn(false); assertFalse(remotePeerBean.isLeader()); }
0
* Copyright 1999-2004 The Apache Software Foundation. * * 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. */ * @version CVS $Id: ParentAware.java,v 1.3 2004/03/05 13:02:45 bdelacretaz Exp $
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
final String clusterPath = "/api/v1/clusters/Test"; expect(clusterStreamProvider.readFrom(eq( clusterPath + "?fields=services/ServiceInfo,hosts,Clusters"), expect(clusterStreamProvider.readFrom(eq(clusterPath + "/configurations?(type=test-site&tag=TAG)"), RemoteAmbariCluster cluster = new RemoteAmbariCluster("Test", clusterPath, clusterStreamProvider); final String clusterPath = "/api/v1/clusters/Test"; expect(clusterStreamProvider.readFrom(eq(String.format("%s/services/%s/components/%s?" + "fields=host_components/HostRoles/host_name", clusterPath, service, component)), RemoteAmbariCluster cluster = new RemoteAmbariCluster("Test", clusterPath, clusterStreamProvider); }
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * 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 org.apache.cocoon.components.treeprocessor; import org.apache.cocoon.environment.Environment; /** * A no-op node to stub not yet implemented features. * * @version $Id$ */ public class NullNode extends AbstractProcessingNode { public NullNode() { super(null); } public final boolean invoke(Environment env, InvokeContext context) throws Exception { getLogger().warn("Invoke on NullNode at " + getLocation()); return false; } }
0
Pipeline p = FlinkTestPipeline.createForBatch();
0
meta = new File(m_project.getBasedir() + File.separator + "metadata.xml");
0
/** An abstract class that contains common configuration options for creating resources. */ /** Returns a {@link GcsCreateOptions.Builder}. */ /** A builder for {@link GcsCreateOptions}. */
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 * 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.
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 * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * 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.view.huetoambarimigration.resources.scripts.models; public class InstanceModel { String instanceName; int id; public String getInstanceName() { return instanceName; } public void setInstanceName(String instanceName) { this.instanceName = instanceName; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
0
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
0
private static final DateTime DATE_MINUS_2_SEC = DATE.minusSeconds(2);
0