Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
*
ClassLoader classLoader = ClassLoader.getSystemClassLoader( );
result = classLoader.loadClass( className ); | 0 |
// if dir exist and is empty, then empty list is returned...
// hadoop 1.0 will return null if the file doesn't exist
// hadoop 2.0 will throw an exception if the file does not exist
FileStatus[] tabletDirs = null;
try {
tabletDirs = fs.listStatus(new Path(ServerConstants.getTablesDir() + "/" + delTableId));
} catch (FileNotFoundException ex) {
// ignored
} | 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.beam.runners.core.local;
import org.apache.beam.sdk.util.WindowedValue;
import org.joda.time.Instant;
/** An immutable collection of elements which are part of a {@code PCollection}. */
public interface Bundle<T> extends Iterable<WindowedValue<T>> {
/**
* Return the minimum timestamp among elements in this bundle.
*
* <p>This should be equivalent to iterating over all of the elements within a bundle and
* selecting the minimum timestamp from among them.
*/
Instant getMinimumTimestamp();
} | 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
* 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 |
return getPCollectionInputs().stream() | 0 |
import org.apache.xml.security.utils.resolver.ResourceResolverException;
import org.w3c.dom.Attr; | 0 |
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.capture;
import static org.easymock.EasyMock.createMockBuilder;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.createStrictMock;
import static org.easymock.EasyMock.eq;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.reset;
import static org.easymock.EasyMock.verify;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.Provider;
import com.google.inject.persist.PersistService;
// ensure the desired state exists
Assert.assertNotNull(componentDesiredStateDAO.findByName(clusterEntity.getClusterId(), "STORM",
"STORM_REST_API"));
Assert.assertNull(componentDesiredStateDAO.findByName(clusterEntity.getClusterId(), "STORM",
"STORM_REST_API")); | 0 |
<F, T> Adapter rule(Class<F> fromCls, Class<T> toCls,
SimpleConvertFunction<F,T> toFun,
SimpleConvertFunction<T,F> fromFun);
<F, T> Adapter rule(TypeReference<F> fromRef, TypeReference<T> toRef,
SimpleConvertFunction<F,T> toFun,
SimpleConvertFunction<T,F> fromFun);
<F, T> Adapter rule(Type fromType, Type toType,
SimpleConvertFunction<F,T> toFun,
SimpleConvertFunction<T,F> fromFun); | 0 |
InetSocketAddress.createUnresolved("foo", 1234), makePortMap("http-admin", 8080));
Status.ALIVE);
Status.ALIVE);
Status.ALIVE);
Status.ALIVE);
server1.join(InetSocketAddress.createUnresolved("foo", 1000), server1Ports);
server2Ports);
server3.join(InetSocketAddress.createUnresolved("foo", 1002), server3Ports); | 0 |
public class AlertUpdateEvent extends STOMPEvent { | 1 |
import org.apache.zookeeper.KeeperException;
/**
* Place the host:port advertisement for the Monitor's Log4j listener in ZooKeeper
*
* @param conf
* configuration for the instance
* @param instanceId
* instanceId for the instance
* @param hostAddress
* Address that monitor process is bound to
*/
static void startLogListener(AccumuloConfiguration conf, String instanceId, String hostAddress) {
// getLocalPort will return the actual ephemeral port used when '0' was provided.
String logForwardingAddr = hostAddress + ":" + server.getLocalPort();
log.debug("Setting monitor log4j log-forwarding address to: " + logForwardingAddr);
final String path = ZooUtil.getRoot(instanceId) + Constants.ZMONITOR_LOG4J_ADDR;
final ZooReaderWriter zoo = ZooReaderWriter.getInstance();
// Delete before we try to re-create in case the previous session hasn't yet expired
try {
zoo.delete(path, -1);
} catch (KeeperException e) {
// We don't care if the node is already gone
if (!KeeperException.Code.NONODE.equals(e.code())) {
throw e;
}
}
zoo.putEphemeralData(path, logForwardingAddr.getBytes(Constants.UTF8));
log.info("Unable to start/advertise Log4j listener for log-forwarding to monitor", t);
| 0 |
@SerializedName("url_suffix")
private String urlSuffix = "/jmx";
public String getUrlSuffix() {
return urlSuffix;
} | 0 |
* Copyright (C) 2015 Google Inc. | 0 |
import java.nio.ByteBuffer; | 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.cocoon.classloader.fam;
import org.apache.commons.jci.listeners.NotificationListener;
import org.apache.commons.jci.monitor.FilesystemAlterationListener;
/**
*
* @version $Id$
*/
public interface Monitor {
String ROLE = Monitor.class.getName();
void subscribe(final FilesystemAlterationListener listener);
void unsubscribe(final FilesystemAlterationListener listener);
void setSitemapNotifier(NotificationListener sitemapNotifier);
} | 0 |
Map<String, String> namespace = new HashMap<>(); | 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.forms.formmodel;
/**
* The {@link WidgetDefinition} part of a Field widget, see {@link Field} for more information.
*
* @version $Id: FieldDefinition.java,v 1.1 2004/03/09 10:33:50 reinhard Exp $
*/
public class FieldDefinition extends AbstractDatatypeWidgetDefinition {
private boolean required;
public Widget createInstance() {
Field field = new Field(this);
return field;
}
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
} | 0 |
package org.apache.accumulo.core.trace;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.zookeeper.ZooReader;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.zookeeper.KeeperException;
import cloudtrace.instrument.Tracer;
public class DistributedTrace {
public static void enable(Instance instance, ZooReader zoo, String application, String address) throws IOException, KeeperException, InterruptedException {
String path = ZooUtil.getRoot(instance) + Constants.ZTRACERS;
if (address == null) {
try {
address = InetAddress.getLocalHost().getHostAddress().toString();
} catch (UnknownHostException e) {
address = "unknown";
}
}
Tracer.getInstance().addReceiver(new ZooTraceClient(zoo, path, address, application, 1000));
}
} | 1 |
public void prepDelete(ZooStore<T> zs, IZooReaderWriter zk, String path, String txidStr) {
checkGlobalLock(zk, path);
public void prepFail(ZooStore<T> zs, IZooReaderWriter zk, String path, String txidStr) {
checkGlobalLock(zk, path);
public void checkGlobalLock(IZooReaderWriter zk, String path) {
try {
if (ZooLock.getLockData(zk.getZooKeeper(), path) != null) {
System.err.println("ERROR: Master lock is held, not running");
System.exit(-1);
}
} catch (KeeperException e) {
System.err.println("ERROR: Could not read master lock, not running " + e.getMessage());
System.exit(-1);
} catch (InterruptedException e) {
System.err.println("ERROR: Could not read master lock, not running" + e.getMessage()); | 0 |
public Object newInstance() throws InstantiationException {
try {
return beanClass.newInstance();
} catch (IllegalAccessException e) {
throw new InstantiationException(e.toString());
} | 0 |
error(String.format("Failed to get %s row count: ", tableName), e);
error("Exception occurred during check for config selected more than once procedure: ", e);
error("Exception occurred during check for host without state procedure: ", e);
error("Exception occurred during topology request tables check: ", e);
error("Exception occurred during check for same count of host component states and host component desired states: ", e);
error("Exception occurred during checking MySQL engine to be innodb: ", e);
error("Exception occurred during complex service check procedure: ", e); | 0 |
* @see #getPixelUnitToMillimeter() | 0 |
private final boolean multiUser;
ExceptionalFunction<FileCopyRequest, File, IOException> fileCopier,
@MultiUserMode boolean multiUser) {
this.multiUser = multiUser;
pidFetcher, new File(executorRootDir, task.getTaskId()), task, fileCopier, multiUser); | 0 |
import static org.apache.aurora.scheduler.updater.StateEvaluator.Result.EVALUATE_AFTER_MIN_RUNNING_MS;
public class OneWayJobUpdateControllerTest extends EasyMockTest {
EVALUATE_AFTER_MIN_RUNNING_MS);
3, InstanceAction.EVALUATE_AFTER_MIN_RUNNING_MS)); | 0 |
import java.io.FileInputStream;
Document doc = XMLUtils.parse(new FileInputStream(new File(dir, file)), false, false); | 0 |
import org.apache.accumulo.core.client.admin.CompactionConfig;
import org.apache.accumulo.proxy.thrift.CompactionStrategyConfig;
List<org.apache.accumulo.proxy.thrift.IteratorSetting> iterators, boolean flush, boolean wait, CompactionStrategyConfig compactionStrategy)
CompactionConfig compactionConfig = new CompactionConfig().setStartRow(ByteBufferUtil.toText(startRow)).setEndRow(ByteBufferUtil.toText(endRow))
.setIterators(getIteratorSettings(iterators)).setFlush(flush).setWait(wait);
if (compactionStrategy != null) {
org.apache.accumulo.core.client.admin.CompactionStrategyConfig ccc = new org.apache.accumulo.core.client.admin.CompactionStrategyConfig(
compactionStrategy.getClassName());
if (compactionStrategy.options != null)
ccc.setOptions(compactionStrategy.options);
compactionConfig.setCompactionStrategy(ccc);
}
getConnector(login).tableOperations().compact(tableName, compactionConfig); | 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.
*/
package org.apache.felix.schematizer.impl;
import org.osgi.dto.DTO;
public class MyEmbeddedDTO2<T> extends DTO {
public T value;
}
| 0 |
Copyright 2001,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.
*/ | 0 |
@Command(scope = "config", name = "list", description = "Lists existing configurations.")
@Argument(index = 0, name = "query", description = "Specify a LDAP query", required = false, multiValued = false) | 0 |
* @version $Revision$ $Date$ | 0 |
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.expect;
import org.easymock.EasyMockSupport;
import org.junit.Assert;
import org.junit.Test; | 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.felix.scr.impl.inject;
import org.apache.felix.scr.impl.manager.ComponentContextImpl;
import org.apache.felix.scr.impl.manager.RefPair;
public class BindParameters
{
private final ComponentContextImpl<?> componentContext;
private final RefPair<?, ?> refPair;
public BindParameters(ComponentContextImpl<?> componentContext, RefPair<?, ?> refPair)
{
this.componentContext = componentContext;
this.refPair = refPair;
}
public ComponentContextImpl<?> getComponentContext()
{
return componentContext;
}
public RefPair<?, ?> getRefPair()
{
return refPair;
}
} | 0 |
protected Trigger getContinuationTrigger(List<Trigger> continuationTriggers) { | 0 |
final int size = stack.size();
final Field[] fields = _clazz.getFields();
for (final Field field : fields) {
final Method[] methods = _clazz.getMethods();
for (final Method method : methods) {
final Attribute[] attributes = _clazz.getAttributes();
for (final Attribute attribute : attributes) {
final AnnotationEntry[] entries = annotation.getAnnotationEntries();
for (final AnnotationEntry entrie : entries) {
final Attribute[] attributes = field.getAttributes();
for (final Attribute attribute : attributes) {
final Attribute[] attributes = method.getAttributes();
for (final Attribute attribute : attributes) {
final CodeException[] table = code.getExceptionTable();
for (final CodeException element : table) {
final Attribute[] attributes = code.getAttributes();
for (final Attribute attribute : attributes) {
final LineNumber[] numbers = table.getLineNumberTable();
for (final LineNumber number : numbers) {
final LocalVariable[] vars = table.getLocalVariableTable();
for (final LocalVariable var : vars) {
final StackMapEntry[] vars = table.getStackMap();
for (final StackMapEntry var : vars) {
final Constant[] constants = cp.getConstantPool();
final InnerClass[] ics = ic.getInnerClasses();
for (final InnerClass ic2 : ics) { | 1 |
ASSIGN('='), PIPE('|'), SEMICOLON(';'), NEWLINE, ARRAY, CLOSURE, EXPR, EXECUTION, WORD, EOT;
final char push2;
final char pop2;
push2 = 0;
pop2 = 0;
if (peek() == '(') {
getch();
push2 = '(';
type = Type.EXPR;
pop = ')';
pop2 = ')';
} else {
type = Type.EXECUTION;
push2 = 0;
pop = ')';
pop2 = 0;
}
push2 = 0;
pop2 = 0;
push2 = 0;
pop2 = 0;
if (push == ch) {
}
else if (pop == ch && --depth == 0) {
if (pop2 == 0)
return text.subSequence(start, index - 1);
else if (pop2 == peek()) {
getch();
return text.subSequence(start, index - 2);
}
}
{
if ('(' == peek())
{
val = evaluate.eval(new Token(Type.EXPR, group(), sLine, sCol));
getch();
}
else
{
// support $(...) FELIX-2433
val = evaluate.eval(new Token(Type.EXECUTION, group(), sLine, sCol));
getch();
} | 0 |
import java.util.HashMap;
import java.util.Map;
import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
import org.apache.ambari.server.state.RepositoryType;
import com.google.inject.Provider;
private final RepositoryVersionDAO m_repositoryVersionDao = Mockito.mock(RepositoryVersionDAO.class);
m_check.repositoryVersionDaoProvider = new Provider<RepositoryVersionDAO>() {
@Override
public RepositoryVersionDAO get() {
return m_repositoryVersionDao;
};
};
RepositoryVersionEntity rve = Mockito.mock(RepositoryVersionEntity.class);
Mockito.when(rve.getType()).thenReturn(RepositoryType.STANDARD);
Mockito.when(m_repositoryVersionDao.findByStackNameAndVersion(Mockito.anyString(), Mockito.anyString())).thenReturn(rve); | 0 |
/**
* @deprecated since 1.4
*/ | 0 |
if (bean instanceof Element) {
if (bean instanceof Element) { | 1 |
package org.apache.felix.karaf.gshell.obr;
import org.apache.felix.karaf.gshell.core.OsgiCommandSupport; | 0 |
private List<String> supportedProjectTypes = Arrays.asList( new String[]
} catch (final SCRDescriptorFailureException sdfe) {
final List<Artifact> artifacts = this.project.getCompileArtifacts();
final ArrayList<URL> path = new ArrayList<URL>();
for (final Iterator<Artifact> ai = artifacts.iterator(); ai.hasNext();) {
final Artifact a = ai.next(); | 0 |
return Arrays.toString(columnFamily) + ":" + Arrays.toString(columnQualifier) + " ["
+ Arrays.toString(columnVisibility) + "] " + (hasTimestamp ? timestamp : "NO_TIME_STAMP") + " " + Arrays.toString(val) + " " + deleted;
+ (hasTimestamp ? (Boolean.TRUE.hashCode() + Long.valueOf(timestamp).hashCode()) : Boolean.FALSE.hashCode()) | 0 |
suite.addTest(TestNIOSSLHttp.suite()); | 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull; | 0 |
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
return getInstance().getConnector(getCredentials());
if (this.principal == null || this.getToken() == null)
throw new AccumuloSecurityException("You must provide a user (-u) and password (-p)", SecurityErrorCode.BAD_CREDENTIALS); | 0 |
* Parameter names for HTTP cookie management classes.
* Defines valid date patterns to be used for parsing non-standard
* <code>expires</code> attribute. Only required for compatibility
* with non-compliant servers that still use <code>expires</code>
* defined in the Netscape draft instead of the standard
* <code>max-age</code> attribute.
* The collection elements must be of type {@link String} compatible
* with the syntax of {@link java.text.SimpleDateFormat}.
* Defines whether cookies should be forced into a single
* <code>Cookie</code> request header. Otherwise, each cookie is formatted
* as a separate <code>Cookie</code> header. | 0 |
package org.apache.jcp.xml.dsig.internal.dom; | 0 |
private Set<String> memberAttributes = new HashSet<>(); | 1 |
return decodeInternal(base64, -1);
if (encoded == null)
return null;
byte []bytes=new byte[encoded.length()];
int len=getBytesInternal(encoded, bytes);
return decodeInternal(bytes, len);
protected static final int getBytesInternal(String s,byte[] result) {
int length=s.length();
int newSize=0;
for (int i = 0; i < length; i++) {
byte dataS=(byte)s.charAt(i);
if (!isWhiteSpace(dataS))
result[newSize++] = dataS;
}
return newSize;
}
protected final static byte[] decodeInternal(byte[] base64Data, int len) throws Base64DecodingException {
if (len==-1)
len = removeWhiteSpace(base64Data);
/**
* Decodes Base64 data into outputstream
*
* @param base64Data String containing Base64 data
* @param os the outputstream
* @throws IOException
* @throws Base64DecodingException
*/
public final static void decode(String base64Data,
OutputStream os) throws Base64DecodingException, IOException {
byte[] bytes=new byte[base64Data.length()];
int len=getBytesInternal(base64Data, bytes);
decode(bytes,os,len);
}
decode(base64Data,os,-1);
}
protected final static void decode(byte[] base64Data,
OutputStream os,int len) throws Base64DecodingException, IOException {
// remove white spaces
if (len==-1)
len = removeWhiteSpace(base64Data); | 0 |
* Defines events fired by a Form object.
* @version CVS $Id: FormListener.java,v 1.2 2003/04/26 12:10:44 stephan Exp $
* This method is called before
* Semantically similar to that of the
* @param form
* Filters custom request parameter
* not refering to the model.
*
* @param form
* @param parameterName
*
* @return | 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 |
private static volatile AtlasPluginClassLoader me = null;
AtlasPluginClassLoader ret = me;
if (ret == null) {
synchronized (AtlasPluginClassLoader.class) {
ret = me;
if (ret == null) {
me = AccessController.doPrivileged(new PrivilegedExceptionAction<AtlasPluginClassLoader>() {
public AtlasPluginClassLoader run() throws Exception {
return new AtlasPluginClassLoader(pluginType, pluginClass);
}
});
ret = me;
}
}
} | 0 |
TaskTag tag = new TaskTag( task );
tag.setTrim( true ); | 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 |
import com.google.cloud.dataflow.sdk.transforms.DoFn.RequiresWindowAccess;
private final class FormatCountsDoFn
extends DoFn<KV<String, Long>, String> implements RequiresWindowAccess {
@Override
public void processElement(ProcessContext c) {
c.output(c.element().getKey() + ":" + c.element().getValue()
+ ":" + c.timestamp().getMillis() + ":" + c.window());
}
}
.named("FormatCounts").of(new FormatCountsDoFn()))
+ ":[" + new Instant(windowStart) + ".." + new Instant(windowEnd) + ")"; | 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 |
* package com.example;
*
* <p>If your enumerated type does not provide a {@link java.lang.Object#toString()}
* method, the enum convertor will use the fully qualified class name,
* followed by the name of the public static final field referring to
* each instance, i.e. "com.example.Sex.MALE", "com.example.Sex.FEMALE"
* and so on.</p>
* <p>If you provide a toString() method which returns something
* different, you should also provide a fromString(String, Locale)
* method to convert those strings back to instances.
*
* @version CVS $Id: EnumType.java,v 1.5 2003/11/29 15:37:57 ugo Exp $ | 0 |
* @author <A HREF="mailto:[email protected]">M. Dahm</A> | 0 |
workerThreadFactory, | 0 |
long timestamp, long startTime) { | 0 |
import org.apache.http.Consts;
byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1.name());
byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1.name());
String s = new String(bytes2, Consts.ISO_8859_1.name()); | 0 |
import org.apache.ambari.server.configuration.AmbariServerConfiguration;
bind(new TypeLiteral<Encryptor<AmbariServerConfiguration>>() {}).annotatedWith(Names.named("AmbariServerConfigurationEncryptor")).toInstance(Encryptor.NONE); | 0 |
package org.apache.beam.sdk.extensions.euphoria.operator.test.suite;
import org.apache.beam.sdk.extensions.euphoria.operator.test.FlatMapTest;
import org.apache.beam.sdk.extensions.euphoria.operator.test.JoinTest;
import org.apache.beam.sdk.extensions.euphoria.operator.test.ReduceByKeyTest;
import org.apache.beam.sdk.extensions.euphoria.operator.test.UnionTest; | 0 |
import org.junit.Assert; | 0 |
protected AbstractKerberosAuditEventBuilder(Class<? extends TBuilder> builderClass) {
super(builderClass);
}
return self();
return self();
return self();
return self(); | 0 |
Map<Resource.Type, String> mapIds = new HashMap<>();
Map<Resource.Type, String> mapIds = new HashMap<>(); | 0 |
private final String[] testArray = { "a", "b", "c" }; | 0 |
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@NamedQueries({ @NamedQuery(name = "ClusterConfigEntity.findNextConfigVersion", query = "SELECT COALESCE(MAX(clusterConfig.version),0) + 1 as nextVersion FROM ClusterConfigEntity clusterConfig WHERE clusterConfig.type=:configType AND clusterConfig.clusterId=:clusterId") }) | 0 |
* @version CVS $Id: AbstractSAXTransformer.java,v 1.4 2003/06/19 11:19:25 jefft Exp $
//if (this.getLogger().isDebugEnabled()) {
// this.getLogger().debug("BEGIN startTransformingElement uri=" + uri + ", name=" + name + ", raw=" + raw + ", attr=" + attr + ")");
//}
//if (this.getLogger().isDebugEnabled()) {
// this.getLogger().debug("END startTransformingElement");
//}
//if (this.getLogger().isDebugEnabled()) {
// this.getLogger().debug("BEGIN endTransformingElement uri=" + uri + ", name=" + name + ", raw=" + raw + ")");
//}
//if (this.getLogger().isDebugEnabled()) {
// this.getLogger().debug("END endTransformingElement");
//} | 0 |
import org.apache.accumulo.core.client.AccumuloClient;
AccumuloClient c = getAccumuloClient(); | 0 |
return String.join(",", builder.command()); | 0 |
import java.util.Arrays;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SerializableThrowable that = (SerializableThrowable) o;
return Arrays.equals(stackTrace, that.stackTrace);
}
@Override
public int hashCode() {
return Arrays.hashCode(stackTrace);
} | 0 |
* @version $Id$ | 0 |
* Copyright (c) OSGi Alliance (2010, 2015). All Rights Reserved.
* Http Whiteboard Context Package Version 1.0. | 0 |
import org.apache.commons.lang.RandomStringUtils;
String oneWayPort = RandomStringUtils.randomNumeric(4);
String twoWayPort = RandomStringUtils.randomNumeric(4);
ambariProperties.setProperty(Configuration.SRVR_TWO_WAY_SSL_PORT_KEY, twoWayPort.toString());
ambariProperties.setProperty(Configuration.SRVR_ONE_WAY_SSL_PORT_KEY, oneWayPort.toString());
Assert.assertEquals(Integer.parseInt(twoWayPort), conf.getTwoWayAuthPort());
Assert.assertEquals(Integer.parseInt(oneWayPort), conf.getOneWayAuthPort()); | 0 |
import org.apache.http.client.utils.DateUtils; | 0 |
/*
* $Id: FilterImpl.java 44 2007-07-13 20:49:41Z [email protected] $
*
* Copyright (c) OSGi Alliance (2002, 2006, 2007). All Rights Reserved.
* 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. | 0 |
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString; | 0 |
*
*/
private static final long serialVersionUID = 1L; | 1 |
import java.util.Properties;
import org.apache.accumulo.core.security.handler.Authenticator;
@Deprecated
* @return the canonical name of the helper class for the security token from the authenticator, if one exists.
* A known SecurityToken type. If uncertain which should be provided, use {@link #getAuthenticatorClassName()} and
* {@link Authenticator#login(Properties)}
| 0 |
* Autogenerated by Thrift Compiler (0.10.0)
public enum ScanType implements org.apache.thrift.TEnum { | 0 |
* An alert definition was updated.
*/
ALERT_DEFINITION_CHANGED,
/** | 0 |
* <li>{@link AccumuloInputFormat#setClientProperties(JobConf, java.util.Properties)} | 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 |
import org.apache.beam.sdk.state.TimeDomain; | 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 | 1 |
final Map<String, Header> challenges = new HashMap<>();
final Map<String, Header> challenges = new HashMap<>();
final Map<String, Header> challenges = new HashMap<>();
final Map<String, Header> challenges = new HashMap<>();
final Map<String, Header> challenges = new HashMap<>();
final Map<String, Header> challenges = new HashMap<>();
final Map<String, Header> challenges = new HashMap<>(); | 0 |
* A <code>Selector</code> that matches a getMethod() of the HTTP request.
* | 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.template.script;
import org.apache.cocoon.el.DefaultContext;
import org.apache.cocoon.xml.XMLConsumer;
public class ScriptContext extends DefaultContext {
XMLConsumer consumer;
ScriptInvoker scriptInvoker;
public XMLConsumer getConsumer() {
return consumer;
}
public void setConsumer(XMLConsumer consumer) {
this.consumer = consumer;
}
public ScriptInvoker getScriptInvoker() {
return scriptInvoker;
}
public void setScriptInvoker(ScriptInvoker scriptInvoker) {
this.scriptInvoker = scriptInvoker;
}
} | 0 |
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
private static final transient Logger LOG = LoggerFactory.getLogger(XIncludeHandler.class);
LOG.warn(e.getMessage(), e);
LOG.error(e.getMessage(), e);
LOG.error(e.getMessage(), e); | 0 |
import org.apache.commons.jexl3.JexlException;
&& objectClass.equals(obj.getClass())
// ensure method name matches the property name
&& method != null
&& ((property == null && key == null)
|| (property != null && property.equals(key)))) {
} catch (InvocationTargetException xinvoke) {
throw JexlException.tryFailed(xinvoke); // throw
} | 0 |
package com.twitter.nexus.util;
import org.apache.commons.io.IOUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.logging.Logger;
/**
* HdfsUtil - utility functions for dealing with Hadoop's file system
*
* @author Florian Leibert
*/
public class HdfsUtil {
private final static java.util.logging.Logger LOG = Logger.getLogger(HdfsUtil.class.getName());
public static FileSystem getHdfsConfiguration(final String hdfsConfigPath) throws IOException {
Configuration conf = new Configuration(true);
conf.addResource(new Path(hdfsConfigPath));
conf.reloadConfiguration();
FileSystem hdfs = FileSystem.get(conf);
return hdfs;
}
public static File downloadFileFromHdfs(final FileSystem hdfs, final String executorBinaryUrl,
final String localDirName) throws IOException {
Path executorBinaryPath = new Path(executorBinaryUrl);
FSDataInputStream remoteStream = hdfs.open(executorBinaryPath);
File localFile = new File(localDirName + executorBinaryPath.getName());
FileOutputStream localStream = new FileOutputStream(localFile);
try {
IOUtils.copy(remoteStream, localStream);
} finally {
IOUtils.closeQuietly(remoteStream);
IOUtils.closeQuietly(localStream);
}
return localFile;
}
public static boolean isValidFile(final FileSystem hdfs, final String path) throws IOException {
FileStatus[] statuses = hdfs.listStatus(new Path(path));
return (statuses.length == 1 && !statuses[0].isDir() && statuses[0].getBlockSize() > 0L);
}
} | 0 |
return hasAggregators() && aggCount == items.length;
}
public boolean hasAggregators() {
return aggCount > 0; | 0 |
String SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE = "externalResourcesRequired"; | 0 |
assertIterableSize(step1res.getCounters(), 1);
assertIterableSize(step1res.getDistributions(), 1);
assertIterableSize(step1res.getGauges(), 1);
assertIterableSize(step2res.getCounters(), 1);
assertIterableSize(step2res.getDistributions(), 1);
assertIterableSize(step2res.getGauges(), 1);
assertIterableSize(allres.getCounters(), 2);
assertIterableSize(allres.getDistributions(), 2);
assertIterableSize(allres.getGauges(), 2);
assertIterableSize(step1res.getCounters(), 1);
assertIterableSize(step1res.getDistributions(), 1);
assertIterableSize(step1res.getGauges(), 1);
assertIterableSize(step2res.getCounters(), 1);
assertIterableSize(step2res.getDistributions(), 1);
assertIterableSize(step2res.getGauges(), 1);
assertIterableSize(allres.getCounters(), 2);
assertIterableSize(allres.getDistributions(), 2);
assertIterableSize(allres.getGauges(), 2);
metricQueryResults.getCounters(),
metricQueryResults.getDistributions(),
metricQueryResults.getGauges(), | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/UnmodifiableEntrySet.java,v 1.4 2004/01/05 22:15:14 scolebourne Exp $
* Copyright (c) 2003-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.4 $ $Date: 2004/01/05 22:15:14 $
public final class UnmodifiableEntrySet
extends AbstractSetDecorator implements Unmodifiable {
| 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.sshd.common;
/**
* A pseudo random number generator
*/
public interface Random {
/**
* Fill part of bytes with random values.
*
* @param bytes byte array to be filled.
* @param start index to start filling at.
* @param len length of segment to fill.
*/
void fill(byte[] bytes, int start, int len);
} | 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.servicemix.kernel.main.spi;
public interface MainService {
public abstract String[] getArgs();
public int getExitCode();
public void setExitCode(int exitCode);
} | 0 |
LOG.debug("namenodeIDs " + namenodeIDs);
return !StringUtils.isEmpty(namenodeIDs); | 0 |
value, type.getMapKeyType(), type.getMapValueType(), field.getName());
private Map<Object, Object> verifyMap(Object value, TypeName keyTypeName,
FieldType valueType, String fieldName) {
switch (valueType.getTypeName()) {
case ARRAY:
verifiedMap.put(verifyPrimitiveType(kv.getKey(), keyTypeName, fieldName),
verifyArray(kv.getValue(), valueType.getComponentType(), fieldName));
break;
case MAP:
verifiedMap.put(verifyPrimitiveType(kv.getKey(), keyTypeName, fieldName),
verifyMap(kv.getValue(), valueType.getMapKeyType(),
valueType.getMapValueType(), fieldName));
break;
case ROW:
verifiedMap.put(verifyPrimitiveType(kv.getKey(), keyTypeName, fieldName),
verifyRow(kv.getValue(), fieldName));
break;
default:
verifiedMap.put(verifyPrimitiveType(kv.getKey(), keyTypeName, fieldName),
verifyPrimitiveType(kv.getValue(), valueType.getTypeName(), fieldName));
} | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.