code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public synchronized void startAttributePolling(final AttributeImpl attr) throws DevFailed {
addAttributePolling(attr);
LOGGER.debug("starting attribute {} for polling on device {}", attr.getName(), deviceName);
if (attr.getPollingPeriod() != 0) {
attributeCacheMap.get(attr).startRefr... | java |
private void addAttributePolling(final AttributeImpl attr) throws DevFailed {
if (MANAGER == null) {
startCache();
}
removeAttributePolling(attr);
final AttributeCache cache = new AttributeCache(MANAGER, attr, deviceName, deviceLock, aroundInvoke);
if (attr.getPolling... | java |
public synchronized void removeAttributePolling(final AttributeImpl attr) throws DevFailed {
if (attributeCacheMap.containsKey(attr)) {
final AttributeCache cache = attributeCacheMap.get(attr);
cache.stopRefresh();
attributeCacheMap.remove(attr);
} else if (extTrigAtt... | java |
public synchronized void removeAll() {
for (final AttributeCache cache : attributeCacheMap.values()) {
cache.stopRefresh();
}
attributeCacheMap.clear();
extTrigAttributeCacheMap.clear();
for (final CommandCache cache : commandCacheMap.values()) {
cache.sto... | java |
public synchronized void removeCommandPolling(final CommandImpl command) throws DevFailed {
if (commandCacheMap.containsKey(command)) {
final CommandCache cache = commandCacheMap.get(command);
cache.stopRefresh();
commandCacheMap.remove(command);
} else if (extTrigCom... | java |
public synchronized void start() {
for (final AttributeCache cache : attributeCacheMap.values()) {
cache.startRefresh(POLLING_POOL);
}
for (final CommandCache cache : commandCacheMap.values()) {
cache.startRefresh(POLLING_POOL);
}
if (stateCache != null) {... | java |
public synchronized void stop() {
for (final AttributeCache cache : attributeCacheMap.values()) {
cache.stopRefresh();
}
for (final CommandCache cache : commandCacheMap.values()) {
cache.stopRefresh();
}
if (stateCache != null) {
stateCache.sto... | java |
public synchronized SelfPopulatingCache getAttributeCache(final AttributeImpl attr) throws NoCacheFoundException {
if (attr.getName().equalsIgnoreCase(DeviceImpl.STATE_NAME)) {
return stateCache.getCache();
} else if (attr.getName().equalsIgnoreCase(DeviceImpl.STATUS_NAME)) {
ret... | java |
public synchronized SelfPopulatingCache getCommandCache(final CommandImpl cmd) {
SelfPopulatingCache cache = null;
if (cmd.getName().equalsIgnoreCase(DeviceImpl.STATE_NAME)) {
cache = stateCache.getCache();
} else if (cmd.getName().equalsIgnoreCase(DeviceImpl.STATUS_NAME)) {
... | java |
public boolean isOver() {
if (!isOver) {
final long now = System.currentTimeMillis();
isOver = now - startTime >= duration;
}
return isOver;
} | java |
public String getAttributePropertyFromDB(final String attributeName, final String propertyName) throws DevFailed {
xlogger.entry(propertyName);
String[] result = new String[] {};
final Map<String, String[]> prop = DatabaseFactory.getDatabase().getAttributeProperties(deviceName,
a... | java |
public void setAttributePropertyInDB(final String attributeName, final String propertyName, final String value)
throws DevFailed {
xlogger.entry(propertyName);
// insert value in db only if input value is different and not a
// default value
// if (checkCurrentValue) {
... | java |
public void setAttributePropertiesInDB(final String attributeName, final Map<String, String[]> properties)
throws DevFailed {
xlogger.entry(properties);
final Map<String, String> currentValues = getAttributePropertiesFromDBSingle(attributeName);
final Map<String, String[]> propInser... | java |
private static Properties getPropertiesFile() {
try {
// We use the class loader to load the properties file.
// This compatible with unix and windows.
final InputStream stream = TangoFactory.class.getClassLoader().getResourceAsStream(
FACTORY_PROPERTIES)... | java |
private static Object getObject(final String className) {
try {
// we get the class coresponding to the life cycle name
final Class<?> clazz = Class.forName(className);
// we get the default constructor (with no parameter)
final Constructor<?> contructor = clazz.... | java |
private void initTangoFactory() {
// we get the properties with instance of objects
final Properties properties = getPropertiesFile();
// if(properties == null || properties.size() == 0 ||
// !properties.containsKey(TANGO_FACTORY))
// {
// //tangoFactory = new DefaultTang... | java |
public static void logDevFailed(final DevFailed e, final Logger logger) {
if (e.errors != null) {
for (int i = 0; i < e.errors.length; i++) {
logger.error("Error Level {} :", i);
logger.error("\t - desc: {}", e.errors[i].desc);
logger.error("\t - origi... | java |
public void get_properties(AttributeConfig conf)
{
//
// Copy mandatory properties
//
conf.writable = writable;
conf.data_format = data_format;
conf.max_dim_x = max_x;
conf.max_dim_y = max_y;
conf.data_type = data_type;
conf.name = name;
//
// Copy optional properties
//
conf.label = label;
conf.de... | java |
private String formatValue(String[] value) {
String ret = "";
for(int i=0;i<value.length;i++) {
ret += value[i];
if(i<value.length-1) ret+="\n";
}
return ret;
} | java |
@Override
public Object execute(final Object arg) throws DevFailed {
errorReportMap.clear();
String tmpReplyName = "";
boolean hasFailed = false;
final List<DevError[]> errors = new ArrayList<DevError[]>();
int size = 0;
final DeviceData argin = new DeviceData();
... | java |
static byte[] cppAlignmentAdd8(final byte[] data) {
XLOGGER.entry();
final byte[] buffer = new byte[data.length + 8];
buffer[0] = (byte) 0xc0;
buffer[1] = (byte) 0xde;
buffer[2] = (byte) 0xc0;
buffer[3] = (byte) 0xde;
buffer[4] = (byte) 0xc0;
buffer[5] = (... | java |
static byte[] marshall(final DevFailed devFailed) throws DevFailed {
XLOGGER.entry();
final CDROutputStream os = new CDROutputStream();
try {
DevErrorListHelper.write(os, devFailed.errors);
XLOGGER.exit();
return cppAlignment(os.getBufferCopy());
} fin... | java |
static byte[] marshall(final int counter, final boolean isException) throws DevFailed {
XLOGGER.entry();
final ZmqCallInfo zmqCallInfo = new ZmqCallInfo(EventConstants.ZMQ_RELEASE, counter,
EventConstants.EXECUTE_METHOD, EventConstants.OBJECT_IDENTIFIER, isException);
final CDROu... | java |
static double getZmqVersion() {
XLOGGER.entry();
if (zmqVersion < 0.0) { // Not already checked.
zmqVersion = 0.0;
try {
String strVersion = org.zeromq.ZMQ.getVersionString();
final StringTokenizer stk = new StringTokenizer(strVersion, ".");
... | java |
public static Object get(final AttrValUnion union, final AttrDataFormat format) throws DevFailed {
Object result = null;
if (union != null) {
final AttributeDataType discriminator = union.discriminator();
if (discriminator.value() == AttributeDataType._ATT_NO_DATA) {
... | java |
public static AttrValUnion set(final int tangoType, final Object value) throws DevFailed {
final AttributeDataType discriminator = AttributeTangoType.getTypeFromTango(tangoType).getAttributeDataType();
final AttrValUnion union = new AttrValUnion();
Object array = null;
if (value.getClass... | java |
public void triggerPolling(final String objectName) throws DevFailed {
boolean isACommand = false;
CommandImpl cmd = null;
try {
cmd = CommandGetter.getCommand(objectName, commandList);
isACommand = true;
} catch (final DevFailed e) {
}
if ... | java |
public void addCommandPolling(final String commandName, final int pollingPeriod) throws DevFailed {
checkPollingLimits(commandName, pollingPeriod, minCommandPolling);
final CommandImpl command = CommandGetter.getCommand(commandName, commandList);
if (!command.getName().equals(DeviceImpl.INIT_... | java |
public void addAttributePolling(final String attributeName, final int pollingPeriod) throws DevFailed {
logger.debug("add {} polling with period {}", attributeName, pollingPeriod);
checkPollingLimits(attributeName, pollingPeriod, minAttributePolling);
final AttributeImpl attribute = Attribu... | java |
public void removeAttributePolling(final String attributeName) throws DevFailed {
// jive sends value with lower case, so manage it
final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList);
attribute.resetPolling();
cacheManager.removeAttribute... | java |
public void removeCommandPolling(final String commandName) throws DevFailed {
final CommandImpl command = CommandGetter.getCommand(commandName, commandList);
command.resetPolling();
cacheManager.removeCommandPolling(command);
if (command.getName().equals(DeviceImpl.STATE_NAME) || com... | java |
public void start(final AttributeGroupReader valueReader, final long readingPeriod) {
this.valueReader = valueReader;
this.readingPeriod = readingPeriod;
// create a timer to read attributes
executor = Executors.newScheduledThreadPool(1);
future = executor.scheduleAtFixedRat... | java |
public void stop() {
if (future != null) {
future.cancel(true);
}
if (executor != null) {
executor.shutdownNow();
}
} | java |
public void updateAttributeGroup(final TangoGroupAttribute attributeGroup) {
stop();
final AttributeGroupReader newValueReader = new AttributeGroupReader(valueReader.getAttributeGroupListener(),
attributeGroup, valueReader.isReadWriteValue(), valueReader.isReadQuality(),
... | java |
public static void insert(final Object value, final DeviceAttribute deviceAttributeWritten,
final int dimX, final int dimY) throws DevFailed {
if (value instanceof Short) {
AttributeHelper.insertFromShort((Short) value, deviceAttributeWritten);
} else if (value instanceof String) {
AttributeHelper.ins... | java |
public static Object extract(final DeviceAttribute deviceAttributeRead) throws DevFailed {
Object argout = null;
if (deviceAttributeRead.getDimX() != 1 || deviceAttributeRead.getDimY() != 0) {
argout = extractArray(deviceAttributeRead);
} else {
switch (deviceAttributeRead.getType()) {
case TangoCons... | java |
public static Short extractToShort(final DeviceAttribute deviceAttributeRead) throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
Short argout = null;
if (value instanceof Short) {
argout = (Short) value;
} else if (value instanceof String) {
try {
argout = Short.valueO... | java |
public static String extractToString(final DeviceAttribute deviceAttributeRead)
throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
String argout = null;
if (value instanceof Short) {
argout = ((Short) value).toString();
} else if (value instanceof String) {
argout =... | java |
public static Integer extractToInteger(final DeviceAttribute deviceAttributeRead)
throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
Integer argout = null;
if (value instanceof Short) {
argout = Integer.valueOf(((Short) value).intValue());
} else if (value instanceof Str... | java |
public static Long extractToLong(final DeviceAttribute deviceAttributeRead) throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
Long argout = null;
if (value instanceof Short) {
argout = Long.valueOf(((Short) value).longValue());
} else if (value instanceof String) {
try ... | java |
public static Float extractToFloat(final DeviceAttribute deviceAttributeRead) throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
Float argout = null;
if (value instanceof Short) {
argout = Float.valueOf(((Short) value).floatValue());
} else if (value instanceof String) {
... | java |
public static Boolean extractToBoolean(final DeviceAttribute deviceAttributeRead)
throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
int boolValue = 0;
Boolean argout = Boolean.FALSE;
;
if (value instanceof Short) {
boolValue = ((Short) value).intValue();
} else if (v... | java |
public static Double extractToDouble(final DeviceAttribute deviceAttributeRead)
throws DevFailed {
final Object value = AttributeHelper.extract(deviceAttributeRead);
Double argout = null;
if (value instanceof Short) {
argout = Double.valueOf(((Short) value).doubleValue());
} else if (value instanceof Stri... | java |
public static void insertFromInteger(final Integer integerValue,
final DeviceAttribute deviceAttributeWritten) throws DevFailed {
switch (deviceAttributeWritten.getType()) {
case TangoConst.Tango_DEV_SHORT:
deviceAttributeWritten.insert(integerValue.shortValue());
break;
case TangoConst.Tango_DEV_USH... | java |
public static void insertFromBoolean(final Boolean booleanValue,
final DeviceAttribute deviceAttributeWritten) throws DevFailed {
Integer integerValue = 0;
if (booleanValue.booleanValue()) {
integerValue = 1;
}
switch (deviceAttributeWritten.getType()) {
case TangoConst.Tango_DEV_SHORT:
deviceAttr... | java |
public static void insertFromWAttribute(final WAttribute wAttributeValue,
final DeviceAttribute deviceAttributeWritten) throws DevFailed {
Object value = null;
switch (wAttributeValue.get_data_type()) {
case TangoConst.Tango_DEV_SHORT:
value = Short.valueOf(wAttributeValue.getShortWriteValue());
brea... | java |
public static void insertFromDevState(final DevState devStateValue,
final DeviceAttribute deviceAttributeWritten) throws DevFailed {
final Integer integerValue = Integer.valueOf(devStateValue.value());
switch (deviceAttributeWritten.getType()) {
case TangoConst.Tango_DEV_SHORT:
deviceAttributeWritten.inse... | java |
public final static void fillDbDatumFromDeviceAttribute(final DbDatum dbDatum,
final DeviceAttribute deviceAttribute) throws DevFailed {
switch (deviceAttribute.getType()) {
case TangoConst.Tango_DEV_VOID:
// nothing to do
break;
case TangoConst.Tango_DEV_BOOLEAN:
dbDatum.insert(deviceAttribute... | java |
public void aroundInvoke(final InvocationContext ctx) throws DevFailed {
xlogger.entry();
if (aroundInvokeMethod != null) {
try {
aroundInvokeMethod.invoke(businessObject, ctx);
} catch (final IllegalArgumentException e) {
throw DevFailedUtils.newD... | java |
static void checkStatic(final Field field) throws DevFailed {
if (Modifier.isStatic(field.getModifiers())) {
throw DevFailedUtils.newDevFailed(DevFailedUtils.TANGO_BUILD_FAILED, field + MUST_NOT_BE_STATIC);
}
} | java |
static AttributePropertiesImpl setEnumLabelProperty(final Class<?> type, final AttributePropertiesImpl props)
throws DevFailed {
// if is is an enum set enum values in properties
if (AttributeTangoType.getTypeFromClass(type).equals(AttributeTangoType.DEVENUM)) {
// final Class<En... | java |
public DevState updateState() throws DevFailed {
xlogger.entry();
Object getState;
if (getStateMethod != null) {
try {
getState = getStateMethod.invoke(businessObject);
if (getState != null) {
if (getState instanceof DeviceState) {
... | java |
public synchronized void stateMachine(final DeviceState state) throws DevFailed {
if (state != null) {
this.state = state.getDevState();
if (setStateMethod != null) {
logger.debug("Changing state to {}", state);
try {
if (setStateMethod... | java |
public synchronized void connect_db() {
//
// Try to connect to the database
//
if (_daemon == true) {
boolean connected = false;
while (connected == false) {
try {
db = ApiUtil.get_db_obj();
if (db == null) {
Util.out4.println("Can't contact db server, will try later");
try {
... | java |
public Vector get_device_list(String pattern) {
// - The returned list
final Vector dl = new Vector();
// ------------------------------------------------------------------
// CASE I: pattern does not contain any '*' char - it's a device name
if (pattern.indexOf('*') == -1) {
DeviceImpl dev = null;
try ... | java |
public Vector get_device_list_by_class(final String class_name) throws DevFailed {
//
// Retrieve class list. Don't use the get_dserver_device() method
// followed by
// the get_class_list(). In case of several classes embedded within
// the same server and the use of this method in the object creation, it
// wi... | java |
public DeviceImpl get_device_by_name(String dev_name) throws DevFailed {
//
// Retrieve class list. Don't use the get_dserver_device() method
// followed by
// the get_class_list(). In case of several classes embedded within
// the same server and the use of this method in the object creation, it
// will fail bec... | java |
public void unregister_server() {
Util.out4.println("Entering Tango::unregister_server method");
if (Util._UseDb == true) {
//
// Mark all the devices belonging to this server as unexported
//
try {
db.unexport_server(ds_name.toString());
} catch (final SystemException e) {
Except.pri... | java |
public synchronized void execute(final StateImpl stateImpl, final StatusImpl statusImpl) {
if (isLazy && !isInitInProgress()) {
final Callable<Void> initRunnable = new Callable<Void>() {
@Override
public Void call() throws DevFailed {
logger.debug(... | java |
public PipeBlobBuilder add(String name, Object value){
elements.add(PipeDataElement.newInstance(name, value));
return this;
} | java |
public static final Entry<String, String> splitDeviceEntity(final String entityName) throws DevFailed {
Entry<String, String> result = null;
final Matcher matcher = ENTITY_SPLIT_PATTERN.matcher(entityName.trim());
if (matcher.matches()) {
String device = null;
String ent... | java |
public static Map<String, Collection<String>> splitDeviceEntities(final Collection<String> entityNames) {
final Map<String, Collection<String>> result = new HashMap<String, Collection<String>>();
String device;
String entity;
for (final String entityName : entityNames) {
try... | java |
public static GoogleCredential getApplicationDefaultCredential() {
try {
GoogleCredential credential = GoogleCredential.getApplicationDefault();
if (credential.createScopedRequired()) {
credential =
credential.createScoped(Arrays.asList("https://www.googleapis.com/auth/genomics"));
... | java |
public static Credential getCredentialFromClientSecrets(String clientSecretsFile,
String credentialId) {
Preconditions.checkArgument(clientSecretsFile != null);
Preconditions.checkArgument(credentialId != null);
HttpTransport httpTransport;
try {
httpTransport = GoogleNetHttpTransport.newTr... | java |
public static boolean isOverlapping(Variant blockRecord, Variant.Builder variant) {
return blockRecord.getStart() <= variant.getStart()
&& blockRecord.getEnd() >= variant.getStart() + 1;
} | java |
public static final boolean isSameVariantSite(Variant.Builder variant1, Variant variant2) {
return variant1.getReferenceName().equals(variant2.getReferenceName())
&& variant1.getReferenceBases().equals(variant2.getReferenceBases())
&& variant1.getStart() == variant2.getStart();
} | java |
public static ManagedChannel fromCreds(GoogleCredentials creds, String fields) throws SSLException {
List<ClientInterceptor> interceptors = new ArrayList();
interceptors.add(new ClientAuthInterceptor(creds.createScoped(Arrays.asList(GENOMICS_SCOPE)),
Executors.newSingleThreadExecutor()));
if (!Strin... | java |
public static ManagedChannel fromDefaultCreds(String fields) throws SSLException, IOException {
return fromCreds(CredentialFactory.getApplicationDefaultCredentials(), fields);
} | java |
public static ManagedChannel fromOfflineAuth(OfflineAuth auth, String fields)
throws IOException, GeneralSecurityException {
return fromCreds(auth.getCredentials(), fields);
} | java |
public static List<String> getReadGroupSetIds(String datasetId, OfflineAuth auth) throws IOException {
List<String> output = Lists.newArrayList();
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
Iterable<ReadGroupSet> rgs = Paginator.ReadGroupSets.create(genomics)
.searc... | java |
public static String getReferenceSetId(String readGroupSetId, OfflineAuth auth)
throws IOException {
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
ReadGroupSet readGroupSet = genomics.readgroupsets().get(readGroupSetId)
.setFields("referenceSetId").execute();
ret... | java |
public static List<CoverageBucket> getCoverageBuckets(String readGroupSetId, OfflineAuth auth)
throws IOException {
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
ListCoverageBucketsResponse response =
genomics.readgroupsets().coveragebuckets().list(readGroupSetId).ex... | java |
public static Iterable<Reference> getReferences(String referenceSetId, OfflineAuth auth)
throws IOException {
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
return Paginator.References.create(
genomics).search(new SearchReferencesRequest().setReferenceSetId(referenceS... | java |
public static List<String> getVariantSetIds(String datasetId, OfflineAuth auth)
throws IOException {
List<String> output = Lists.newArrayList();
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
Iterable<VariantSet> vs = Paginator.Variantsets.create(genomics)
.search... | java |
public static Iterable<CallSet> getCallSets(String variantSetId, OfflineAuth auth)
throws IOException {
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
return Paginator.Callsets.create(genomics)
.search(new SearchCallSetsRequest().setVariantSetIds(Lists.newArrayList(va... | java |
public static List<String> getCallSetsNames(String variantSetId, OfflineAuth auth)
throws IOException {
List<String> output = Lists.newArrayList();
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
Iterable<CallSet> cs = Paginator.Callsets.create(genomics)
.search(ne... | java |
public static List<ReferenceBound> getReferenceBounds(String variantSetId, OfflineAuth auth)
throws IOException {
Genomics genomics = GenomicsFactory.builder().build().fromOfflineAuth(auth);
VariantSet variantSet = genomics.variantsets().get(variantSetId).execute();
return variantSet.getReferenceBound... | java |
public static Iterable<Contig> parseContigsFromCommandLine(String contigsArgument) {
return Iterables.transform(Splitter.on(",").split(contigsArgument),
new Function<String, Contig>() {
@Override
public Contig apply(String contigString) {
ArrayList<String> contigInfo = newArr... | java |
List<Contig> getShards(long numberOfBasesPerShard) {
double shardCount = (end - start) / (double) numberOfBasesPerShard;
List<Contig> shards = Lists.newArrayList();
for (int i = 0; i < shardCount; i++) {
long shardStart = start + (i * numberOfBasesPerShard);
long shardEnd = Math.min(end, shardSt... | java |
@Deprecated
public StreamVariantsRequest getStreamVariantsRequest(String variantSetId) {
return StreamVariantsRequest.newBuilder()
.setVariantSetId(variantSetId)
.setReferenceName(referenceName)
.setStart(start)
.setEnd(end)
.build();
} | java |
@Deprecated
public StreamReadsRequest getStreamReadsRequest(String readGroupSetId) {
return StreamReadsRequest.newBuilder()
.setReadGroupSetId(readGroupSetId)
.setReferenceName(referenceName)
.setStart(start)
.setEnd(end)
.build();
} | java |
public StreamVariantsRequest getStreamVariantsRequest(StreamVariantsRequest prototype) {
return StreamVariantsRequest.newBuilder(prototype)
.setReferenceName(referenceName)
.setStart(start)
.setEnd(end)
.build();
} | java |
public StreamReadsRequest getStreamReadsRequest(StreamReadsRequest prototype) {
return StreamReadsRequest.newBuilder(prototype)
.setReferenceName(referenceName)
.setStart(start)
.setEnd(end)
.build();
} | java |
public Credential getCredential() {
if (hasStoredCredential()) {
HttpTransport httpTransport;
try {
httpTransport = GoogleNetHttpTransport.newTrustedTransport();
} catch (IOException | GeneralSecurityException e) {
throw new RuntimeException("Could not create HTTPS transport for us... | java |
public <T extends AbstractGoogleJsonClient.Builder> T fromApiKey(T builder, String apiKey) {
Preconditions.checkNotNull(builder);
Preconditions.checkNotNull(apiKey);
return prepareBuilder(builder, null, new CommonGoogleClientRequestInitializer(apiKey));
} | java |
public <T extends AbstractGoogleJsonClient.Builder> T fromCredential(T builder, Credential credential) {
Preconditions.checkNotNull(builder);
Preconditions.checkNotNull(credential);
return prepareBuilder(builder, credential, null);
} | java |
public <T extends AbstractGoogleJsonClient.Builder> T fromApplicationDefaultCredential(T builder) {
Preconditions.checkNotNull(builder);
return fromCredential(builder, CredentialFactory.getApplicationDefaultCredential());
} | java |
public Genomics fromOfflineAuth(OfflineAuth auth) {
Preconditions.checkNotNull(auth);
return fromOfflineAuth(getGenomicsBuilder(), auth).build();
} | java |
public <T extends AbstractGoogleJsonClient.Builder> T fromOfflineAuth(T builder, OfflineAuth auth) {
Preconditions.checkNotNull(builder);
Preconditions.checkNotNull(auth);
if(auth.hasApiKey()) {
return fromApiKey(builder, auth.getApiKey());
}
return fromCredential(builder, auth.getCredential()... | java |
public static final BiMap<String, String> getCallSetNameMapping(Iterable<CallSet> callSets) {
BiMap<String, String> idToName = HashBiMap.create();
for(CallSet callSet : callSets) {
// Dev Note: Be sure to keep this map loading as id -> name since it ensures that
// the values are unique.
idToN... | java |
public final Iterable<ItemT> search(final RequestT request) {
return search(request, DEFAULT_INITIALIZER, RetryPolicy.defaultPolicy());
} | java |
public final <F> F search(
RequestT request,
GenomicsRequestInitializer<? super RequestSubT> initializer,
Callback<ItemT, ? extends F> callback,
RetryPolicy retryPolicy) throws IOException {
try {
return callback.consumeResponses(search(request, initializer, retryPolicy));
} catch ... | java |
public final Iterable<ItemT> search(final RequestT request, final String fields) {
return search(request, setFieldsInitializer(fields), RetryPolicy.defaultPolicy());
} | java |
public static ImmutableList<StreamReadsRequest> getReadRequests(final StreamReadsRequest prototype,
SexChromosomeFilter sexChromosomeFilter, long numberOfBasesPerShard,
OfflineAuth auth) throws IOException {
Iterable<Contig> shards = getAllShardsInReadGroupSet(prototype.getReadGroupSetId(), sexChromosom... | java |
@Deprecated
public static ImmutableList<StreamVariantsRequest> getVariantRequests(final String variantSetId,
SexChromosomeFilter sexChromosomeFilter, long numberOfBasesPerShard,
OfflineAuth auth) throws IOException {
Iterable<Contig> shards = getAllShardsInVariantSet(variantSetId,
sexChromosom... | java |
public static Predicate<Variant> getStrictVariantPredicate(final long start, String fields) {
Preconditions
.checkArgument(Strings.isNullOrEmpty(fields)
|| VARIANT_FIELD_PATTERN.matcher(fields).matches(),
"Insufficient fields requested in partial response. At a minimum "
+ "include '... | java |
public static Predicate<Read> getStrictReadPredicate(final long start, final String fields) {
Preconditions
.checkArgument(Strings.isNullOrEmpty(fields)
|| READ_FIELD_PATTERN.matcher(fields).matches(),
"Insufficient fields requested in partial response. At a minimum "
+ "include 'ali... | java |
private static AmazonWebServiceRequest generateRequest(
ActionContext context,
Class<?> type,
RequestModel model,
AmazonWebServiceRequest request,
Object token)
throws InstantiationException, IllegalAccessException {
if (request ==... | java |
public static Object getByPath(Object target, List<String> path) {
Object obj = target;
for (String field : path) {
if (obj == null) {
return null;
}
obj = evaluate(obj, trimType(field));
}
return obj;
} | java |
public static List<Object> getAllByPath(Object target, List<String> path) {
List<Object> results = new LinkedList<>();
// TODO: Can we unroll this and do it iteratively?
getAllByPath(target, path, 0, results);
return results;
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.