idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,363,720
|
private NodeMap createNodeMap(Optional<CatalogName> catalogName) {<NEW_LINE>Set<InternalNode> nodes = catalogName.map(nodeManager::getActiveConnectorNodes).orElseGet(() -> nodeManager.getNodes(ACTIVE));<NEW_LINE>Set<String> coordinatorNodeIds = nodeManager.getCoordinators().stream().map(InternalNode::getNodeIdentifier).collect(toImmutableSet());<NEW_LINE>ImmutableSetMultimap.Builder<HostAddress, InternalNode> byHostAndPort = ImmutableSetMultimap.builder();<NEW_LINE>ImmutableSetMultimap.Builder<InetAddress, InternalNode> byHost = ImmutableSetMultimap.builder();<NEW_LINE>for (InternalNode node : nodes) {<NEW_LINE>try {<NEW_LINE>byHostAndPort.put(node.getHostAndPort(), node);<NEW_LINE>byHost.put(node.getInternalAddress(), node);<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>if (markInaccessibleNode(node)) {<NEW_LINE>LOG.warn(e, "Unable to resolve host name for node: %s", node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new NodeMap(byHostAndPort.build(), byHost.build(), <MASK><NEW_LINE>}
|
ImmutableSetMultimap.of(), coordinatorNodeIds);
|
313,932
|
public StatusInfo build() {<NEW_LINE>if (result.instanceInfo == null) {<NEW_LINE>throw new IllegalStateException("instanceInfo can not be null");<NEW_LINE>}<NEW_LINE>result.generalStats.put("server-uptime", getUpTime());<NEW_LINE>if (ARCHAIUS_EXISTS) {<NEW_LINE>result.generalStats.put("environment", ConfigurationManager.<MASK><NEW_LINE>}<NEW_LINE>Runtime runtime = Runtime.getRuntime();<NEW_LINE>int totalMem = (int) (runtime.totalMemory() / 1048576);<NEW_LINE>int freeMem = (int) (runtime.freeMemory() / 1048576);<NEW_LINE>int usedPercent = (int) (((float) totalMem - freeMem) / (totalMem) * 100.0);<NEW_LINE>result.generalStats.put("num-of-cpus", String.valueOf(runtime.availableProcessors()));<NEW_LINE>result.generalStats.put("total-avail-memory", String.valueOf(totalMem) + "mb");<NEW_LINE>result.generalStats.put("current-memory-usage", String.valueOf(totalMem - freeMem) + "mb" + " (" + usedPercent + "%)");<NEW_LINE>return result;<NEW_LINE>}
|
getDeploymentContext().getDeploymentEnvironment());
|
57,516
|
public </* https://bugs.openjdk.java.net/browse/JDK-8155591 */<NEW_LINE>R> Try<R> of(CheckedFunction7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> f) {<NEW_LINE>return Try.of(() -> {<NEW_LINE>try (T1 t1 = t1Supplier.apply();<NEW_LINE>T2 t2 = t2Supplier.apply();<NEW_LINE>T3 t3 = t3Supplier.apply();<NEW_LINE>T4 t4 = t4Supplier.apply();<NEW_LINE>T5 t5 = t5Supplier.apply();<NEW_LINE>T6 t6 = t6Supplier.apply();<NEW_LINE>T7 t7 = t7Supplier.apply()) {<NEW_LINE>return f.apply(t1, t2, t3, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
t4, t5, t6, t7);
|
630,974
|
private Object executeCollator() throws ExecutionException, Exception {<NEW_LINE>if (collator == null) {<NEW_LINE>if (timeout > 0) {<NEW_LINE>redisson.<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Callable<Object> collatorTask = new CollatorTask<KOut, VOut, Object>(redisson, collator, resultMapName, objectCodecClass);<NEW_LINE>long timeSpent = System.currentTimeMillis() - startTime;<NEW_LINE>if (isTimeoutExpired(timeSpent)) {<NEW_LINE>throw new MapReduceTimeoutException();<NEW_LINE>}<NEW_LINE>if (timeout > 0) {<NEW_LINE>ExecutorService executor = ((Redisson) redisson).getConnectionManager().getExecutor();<NEW_LINE>java.util.concurrent.Future<?> collatorFuture = executor.submit(collatorTask);<NEW_LINE>try {<NEW_LINE>return collatorFuture.get(timeout - timeSpent, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return null;<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>collatorFuture.cancel(true);<NEW_LINE>throw new MapReduceTimeoutException();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return collatorTask.call();<NEW_LINE>}<NEW_LINE>}
|
getMap(resultMapName).clearExpire();
|
1,010,267
|
public Request<CreateCustomAvailabilityZoneRequest> marshall(CreateCustomAvailabilityZoneRequest createCustomAvailabilityZoneRequest) {<NEW_LINE>if (createCustomAvailabilityZoneRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateCustomAvailabilityZoneRequest> request = new DefaultRequest<CreateCustomAvailabilityZoneRequest>(createCustomAvailabilityZoneRequest, "AmazonRDS");<NEW_LINE>request.addParameter("Action", "CreateCustomAvailabilityZone");<NEW_LINE>request.addParameter("Version", "2014-10-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createCustomAvailabilityZoneRequest.getCustomAvailabilityZoneName() != null) {<NEW_LINE>request.addParameter("CustomAvailabilityZoneName", StringUtils.fromString(createCustomAvailabilityZoneRequest.getCustomAvailabilityZoneName()));<NEW_LINE>}<NEW_LINE>if (createCustomAvailabilityZoneRequest.getExistingVpnId() != null) {<NEW_LINE>request.addParameter("ExistingVpnId", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (createCustomAvailabilityZoneRequest.getNewVpnTunnelName() != null) {<NEW_LINE>request.addParameter("NewVpnTunnelName", StringUtils.fromString(createCustomAvailabilityZoneRequest.getNewVpnTunnelName()));<NEW_LINE>}<NEW_LINE>if (createCustomAvailabilityZoneRequest.getVpnTunnelOriginatorIP() != null) {<NEW_LINE>request.addParameter("VpnTunnelOriginatorIP", StringUtils.fromString(createCustomAvailabilityZoneRequest.getVpnTunnelOriginatorIP()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
(createCustomAvailabilityZoneRequest.getExistingVpnId()));
|
762,419
|
public void marshall(WriteCampaignRequest writeCampaignRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (writeCampaignRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getAdditionalTreatments(), ADDITIONALTREATMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getCustomDeliveryConfiguration(), CUSTOMDELIVERYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getHoldoutPercent(), HOLDOUTPERCENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getHook(), HOOK_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getIsPaused(), ISPAUSED_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getLimits(), LIMITS_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getMessageConfiguration(), MESSAGECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getSchedule(), SCHEDULE_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getSegmentId(), SEGMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getSegmentVersion(), SEGMENTVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTreatmentDescription(), TREATMENTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTreatmentName(), TREATMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getPriority(), PRIORITY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
writeCampaignRequest.getTemplateConfiguration(), TEMPLATECONFIGURATION_BINDING);
|
188,137
|
static String cellValue(Node theRowXml, int theCellIndex) {<NEW_LINE>NodeList cells = ((Element) theRowXml).getElementsByTagName("Cell");<NEW_LINE>for (int i = 0, currentCell = 0; i < cells.getLength(); i++) {<NEW_LINE>Element nextCell = (Element) cells.item(i);<NEW_LINE>String indexVal = nextCell.getAttributeNS("urn:schemas-microsoft-com:office:spreadsheet", "Index");<NEW_LINE>if (StringUtils.isNotBlank(indexVal)) {<NEW_LINE>// 1-indexed for some reason...<NEW_LINE>currentCell = Integer.parseInt(indexVal) - 1;<NEW_LINE>}<NEW_LINE>if (currentCell == theCellIndex) {<NEW_LINE>NodeList <MASK><NEW_LINE>Element dataElem = (Element) dataElems.item(0);<NEW_LINE>if (dataElem == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String retVal = dataElem.getTextContent();<NEW_LINE>return retVal;<NEW_LINE>}<NEW_LINE>currentCell++;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
dataElems = nextCell.getElementsByTagName("Data");
|
640,720
|
private static Map<Class<?>, long[]> makeMIN_MAX() {<NEW_LINE>final Map<Class<?>, long[]> minMaxPairs = new HashMap<Class<?>, long[]>();<NEW_LINE>long[] minMaxPair = new long[] { Byte.MIN_VALUE, Byte.MAX_VALUE };<NEW_LINE>minMaxPairs.put(byte.class, minMaxPair);<NEW_LINE>minMaxPairs.put(Byte.class, minMaxPair);<NEW_LINE>minMaxPair = new long[] { Short.MIN_VALUE, Short.MAX_VALUE };<NEW_LINE>minMaxPairs.put(short.class, minMaxPair);<NEW_LINE>minMaxPairs.put(Short.class, minMaxPair);<NEW_LINE>minMaxPair = new long[] { Integer.MIN_VALUE, Integer.MAX_VALUE };<NEW_LINE>minMaxPairs.<MASK><NEW_LINE>minMaxPairs.put(Integer.class, minMaxPair);<NEW_LINE>minMaxPair = new long[] { Long.MIN_VALUE, Long.MAX_VALUE };<NEW_LINE>minMaxPairs.put(long.class, minMaxPair);<NEW_LINE>minMaxPairs.put(Long.class, minMaxPair);<NEW_LINE>return minMaxPairs;<NEW_LINE>}
|
put(int.class, minMaxPair);
|
598,920
|
protected void doExecute(Task task, GetBucketsAction.Request request, ActionListener<GetBucketsAction.Response> listener) {<NEW_LINE>jobManager.jobExists(request.getJobId(), ActionListener.wrap(ok -> {<NEW_LINE>BucketsQueryBuilder query = new BucketsQueryBuilder().expand(request.isExpand()).includeInterim(request.isExcludeInterim() == false).start(request.getStart()).end(request.getEnd()).anomalyScoreThreshold(request.getAnomalyScore()).sortField(request.getSort()).sortDescending(request.isDescending());<NEW_LINE>if (request.getPageParams() != null) {<NEW_LINE>query.from(request.getPageParams().getFrom()).size(request.getPageParams().getSize());<NEW_LINE>}<NEW_LINE>if (request.getTimestamp() != null) {<NEW_LINE>query.timestamp(request.getTimestamp());<NEW_LINE>} else {<NEW_LINE>query.start(request.getStart());<NEW_LINE>query.<MASK><NEW_LINE>}<NEW_LINE>jobResultsProvider.buckets(request.getJobId(), query, q -> listener.onResponse(new GetBucketsAction.Response(q)), listener::onFailure, client);<NEW_LINE>}, listener::onFailure));<NEW_LINE>}
|
end(request.getEnd());
|
673,452
|
protected void initializeTable() {<NEW_LINE>methodColumn.setCellValueFactory(data -> new ReadOnlyStringWrapper(data.getValue() == null ? null : data.getValue().getValue().getKey()));<NEW_LINE>methodColumn.setCellFactory(col -> new MethodNameTreeTableCell<>(appCtx()));<NEW_LINE>// The column configuration methods should (for now) be called in the same order as the columns are declared in<NEW_LINE>// the FXML.<NEW_LINE>// The only reason is the column view context menu, which collects its menu items in the order of these<NEW_LINE>// declarations. If the order is out of sync, the column view context menu will not have its items in the<NEW_LINE>// correct order.<NEW_LINE>// This will probably, eventually, be remedied by reordering but for now this comment will have to do.<NEW_LINE>cfgPctCol(baseSelfCntPct, "baseSelfCntPct", baseCtx(), getText(COLUMN_SELF_CNT_PCT));<NEW_LINE>cfgPctCol(newSelfCntPct, "newSelfCntPct", newCtx(), getText(COLUMN_SELF_CNT_PCT));<NEW_LINE>cfgPctDiffCol(selfCntPctDiff, "selfCntPctDiff", getText(COLUMN_SELF_CNT_PCT_DIFF));<NEW_LINE>cfgPctCol(baseTotalCntPct, "baseTotalCntPct", baseCtx(), getText(COLUMN_TOTAL_CNT_PCT));<NEW_LINE>cfgPctCol(newTotalCntPct, "newTotalCntPct", newCtx(), getText(COLUMN_TOTAL_CNT_PCT));<NEW_LINE>cfgPctDiffCol(totalCntPctDiff, "totalCntPctDiff", getText(COLUMN_TOTAL_CNT_PCT_DIFF));<NEW_LINE>cfgNrCol(baseSelfCnt, "baseSelfCnt", baseCtx(), getText(COLUMN_SELF_CNT));<NEW_LINE>cfgNrCol(newSelfCnt, "newSelfCnt", newCtx(), getText(COLUMN_SELF_CNT));<NEW_LINE>cfgNrDiffCol(selfCntDiff, "selfCntDiff", getText(COLUMN_SELF_CNT_DIFF));<NEW_LINE>cfgNrCol(baseTotalCnt, "baseTotalCnt", baseCtx(), getText(COLUMN_TOTAL_CNT));<NEW_LINE>cfgNrCol(newTotalCnt, "newTotalCnt", newCtx(), getText(COLUMN_TOTAL_CNT));<NEW_LINE>cfgNrDiffCol(totalCntDiff, "totalCntDiff", getText(COLUMN_TOTAL_CNT_DIFF));<NEW_LINE>cfgPctCol(baseSelfTimePct, "baseSelfTimePct", baseCtx<MASK><NEW_LINE>cfgPctCol(newSelfTimePct, "newSelfTimePct", newCtx(), getText(COLUMN_SELF_TIME_PCT));<NEW_LINE>cfgPctDiffCol(selfTimePctDiff, "selfTimePctDiff", getText(COLUMN_SELF_TIME_PCT_DIFF));<NEW_LINE>cfgPctCol(baseTotalTimePct, "baseTotalTimePct", baseCtx(), getText(COLUMN_TOTAL_TIME_PCT));<NEW_LINE>cfgPctCol(newTotalTimePct, "newTotalTimePct", newCtx(), getText(COLUMN_TOTAL_TIME_PCT));<NEW_LINE>cfgPctDiffCol(totalTimePctDiff, "totalTimePctDiff", getText(COLUMN_TOTAL_TIME_PCT_DIFF));<NEW_LINE>cfgTimeCol(baseSelfTime, "baseSelfTime", baseCtx(), getText(COLUMN_SELF_TIME));<NEW_LINE>cfgTimeCol(newSelfTime, "newSelfTime", newCtx(), getText(COLUMN_SELF_TIME));<NEW_LINE>cfgTimeDiffCol(selfTimeDiff, "selfTimeDiff", getText(COLUMN_SELF_TIME_DIFF));<NEW_LINE>cfgTimeCol(baseTotalTime, "baseTotalTime", baseCtx(), getText(COLUMN_TOTAL_TIME));<NEW_LINE>cfgTimeCol(newTotalTime, "newTotalTime", newCtx(), getText(COLUMN_TOTAL_TIME));<NEW_LINE>cfgTimeDiffCol(totalTimeDiff, "totalTimeDiff", getText(COLUMN_TOTAL_TIME_DIFF));<NEW_LINE>}
|
(), getText(COLUMN_SELF_TIME_PCT));
|
1,097,833
|
public int andCardinality(ArrayContainer x) {<NEW_LINE>if (this.nbrruns == 0) {<NEW_LINE>return x.cardinality;<NEW_LINE>}<NEW_LINE>int rlepos = 0;<NEW_LINE>int arraypos = 0;<NEW_LINE>int andCardinality = 0;<NEW_LINE>int rleval = <MASK><NEW_LINE>int rlelength = (this.getLength(rlepos));<NEW_LINE>while (arraypos < x.cardinality) {<NEW_LINE>int arrayval = (x.content[arraypos]);<NEW_LINE>while (rleval + rlelength < arrayval) {<NEW_LINE>// this will frequently be false<NEW_LINE>++rlepos;<NEW_LINE>if (rlepos == this.nbrruns) {<NEW_LINE>// we are done<NEW_LINE>return andCardinality;<NEW_LINE>}<NEW_LINE>rleval = (this.getValue(rlepos));<NEW_LINE>rlelength = (this.getLength(rlepos));<NEW_LINE>}<NEW_LINE>if (rleval > arrayval) {<NEW_LINE>arraypos = Util.advanceUntil(x.content, arraypos, x.cardinality, this.getValue(rlepos));<NEW_LINE>} else {<NEW_LINE>andCardinality++;<NEW_LINE>arraypos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return andCardinality;<NEW_LINE>}
|
(this.getValue(rlepos));
|
1,276,363
|
public void stopNode(NodeSpec nodeSpec) throws Exception {<NEW_LINE>String clientKey = getNodeClientKey(nodeSpec);<NEW_LINE>NodeClient client = nodeClientCache.getOrDefault(clientKey, null);<NEW_LINE>if (null == client) {<NEW_LINE>client = new NodeClient(nodeSpec.getIp(<MASK><NEW_LINE>nodeClientCache.put(clientKey, client);<NEW_LINE>}<NEW_LINE>ListenableFuture<NodeStopResponse> future = client.stopNode();<NEW_LINE>try {<NEW_LINE>NodeStopResponse response1 = future.get();<NEW_LINE>if (response1.getCode() == RpcCode.OK.ordinal()) {<NEW_LINE>LOG.info("stop response:" + response1.getMessage());<NEW_LINE>} else {<NEW_LINE>LOG.info(response1.getMessage());<NEW_LINE>throw new Exception(response1.getMessage());<NEW_LINE>}<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
|
), nodeSpec.getClientPort());
|
375,543
|
public ApiResponse<Void> syncDeleteSyncClientWithHttpInfo(String id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling syncDeleteSyncClient");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/sync/clients/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
|
final String[] localVarAccepts = {};
|
341,679
|
public Request<DescribeStreamSummaryRequest> marshall(DescribeStreamSummaryRequest describeStreamSummaryRequest) {<NEW_LINE>if (describeStreamSummaryRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeStreamSummaryRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeStreamSummaryRequest> request = new DefaultRequest<MASK><NEW_LINE>String target = "Kinesis_20131202.DescribeStreamSummary";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeStreamSummaryRequest.getStreamName() != null) {<NEW_LINE>String streamName = describeStreamSummaryRequest.getStreamName();<NEW_LINE>jsonWriter.name("StreamName");<NEW_LINE>jsonWriter.value(streamName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
<DescribeStreamSummaryRequest>(describeStreamSummaryRequest, "AmazonKinesis");
|
1,107,998
|
// This method is used to update expiration times in disk entry header<NEW_LINE>public synchronized boolean updateExpirationInHeader(Object key, long expirationTime, long validatorExpirationTime) throws IOException, EOFException, FileManagerException, ClassNotFoundException, HashtableOnDiskException {<NEW_LINE>if (filemgr == null) {<NEW_LINE>throw new HashtableOnDiskException("No Filemanager");<NEW_LINE>}<NEW_LINE>if (key == null)<NEW_LINE>// no null keys allowed<NEW_LINE>return false;<NEW_LINE>HashtableEntry entry = findEntry<MASK><NEW_LINE>if (entry == null)<NEW_LINE>// not found<NEW_LINE>return false;<NEW_LINE>//<NEW_LINE>// Seek to point to validator expiration time field in the header<NEW_LINE>filemgr.seek(// room for next<NEW_LINE>entry.location + // room for hash<NEW_LINE>DWORDSIZE + SWORDSIZE);<NEW_LINE>// update VET<NEW_LINE>filemgr.writeLong(validatorExpirationTime);<NEW_LINE>htoddc.returnToHashtableEntryPool(entry);<NEW_LINE>return true;<NEW_LINE>}
|
(key, RETRIEVE_KEY, !CHECK_EXPIRED);
|
1,823,830
|
public static Value SortSeq(Value s, Value cmp) {<NEW_LINE>TupleValue seq = (TupleValue) s.toTuple();<NEW_LINE>if (seq == null) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "first", "SortSeq", "natural number", Values.ppr(s.toString()) });<NEW_LINE>}<NEW_LINE>if (!(cmp instanceof Applicable)) {<NEW_LINE>throw new EvalException(EC.TLC_MODULE_ARGUMENT_ERROR, new String[] { "second", "SortSeq", "function", Values.ppr(cmp.toString()) });<NEW_LINE>}<NEW_LINE>Applicable fcmp = (Applicable) cmp;<NEW_LINE>Value[] elems = seq.elems;<NEW_LINE>int len = elems.length;<NEW_LINE>if (len == 0)<NEW_LINE>return seq;<NEW_LINE>Value[] args = new Value[2];<NEW_LINE>Value[] newElems = new Value[len];<NEW_LINE>newElems[0] = elems[0];<NEW_LINE>for (int i = 1; i < len; i++) {<NEW_LINE>int j = i;<NEW_LINE>args[0] = elems[i];<NEW_LINE>args[1] = newElems[j - 1];<NEW_LINE>while (compare(fcmp, args)) {<NEW_LINE>newElems[j] = newElems[j - 1];<NEW_LINE>j--;<NEW_LINE>if (j == 0)<NEW_LINE>break;<NEW_LINE>args[1] = newElems[j - 1];<NEW_LINE>}<NEW_LINE>newElems<MASK><NEW_LINE>}<NEW_LINE>return new TupleValue(newElems);<NEW_LINE>}
|
[j] = args[0];
|
1,496,104
|
public void marshall(Backup backup, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (backup == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(backup.getBackupId(), BACKUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getLifecycle(), LIFECYCLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getFailureDetails(), FAILUREDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(backup.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getKmsKeyId(), KMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getResourceARN(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getFileSystem(), FILESYSTEM_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getDirectoryInformation(), DIRECTORYINFORMATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getOwnerId(), OWNERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getSourceBackupId(), SOURCEBACKUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getSourceBackupRegion(), SOURCEBACKUPREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(backup.getVolume(), VOLUME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
backup.getProgressPercent(), PROGRESSPERCENT_BINDING);
|
552,061
|
public void init(String title) {<NEW_LINE>assert !htmldoc.getDocumentElement().hasChildNodes();<NEW_LINE>// head<NEW_LINE>Element head = htmldoc.createElement(HTMLUtil.HTML_HEAD_TAG);<NEW_LINE>head.appendChild<MASK><NEW_LINE>htmldoc.getDocumentElement().appendChild(head);<NEW_LINE>// meta with charset information<NEW_LINE>Element meta = htmldoc.createElement(HTMLUtil.HTML_META_TAG);<NEW_LINE>meta.setAttribute(HTMLUtil.HTML_HTTP_EQUIV_ATTRIBUTE, HTMLUtil.HTML_HTTP_EQUIV_CONTENT_TYPE);<NEW_LINE>meta.setAttribute(HTMLUtil.HTML_CONTENT_ATTRIBUTE, HTMLUtil.CONTENT_TYPE_HTML_UTF8);<NEW_LINE>head.appendChild(meta);<NEW_LINE>// stylesheet<NEW_LINE>Element css = htmldoc.createElement(HTMLUtil.HTML_LINK_TAG);<NEW_LINE>css.setAttribute(HTMLUtil.HTML_REL_ATTRIBUTE, HTMLUtil.HTML_REL_STYLESHEET);<NEW_LINE>css.setAttribute(HTMLUtil.HTML_TYPE_ATTRIBUTE, HTMLUtil.CONTENT_TYPE_CSS);<NEW_LINE>css.setAttribute(HTMLUtil.HTML_HREF_ATTRIBUTE, CSSFILE);<NEW_LINE>head.appendChild(css);<NEW_LINE>// title<NEW_LINE>head.appendChild(htmldoc.createElement(HTMLUtil.HTML_TITLE_TAG)).setTextContent(title);<NEW_LINE>// body<NEW_LINE>Element body = htmldoc.createElement(HTMLUtil.HTML_BODY_TAG);<NEW_LINE>//<NEW_LINE>htmldoc.getDocumentElement().appendChild(body).appendChild(htmldoc.createComment(MODIFICATION_WARNING));<NEW_LINE>body.appendChild(htmldoc.createElement(HTMLUtil.HTML_H1_TAG)).setTextContent(title + ":");<NEW_LINE>// Main definition list<NEW_LINE>maindl = htmldoc.createElement(HTMLUtil.HTML_DL_TAG);<NEW_LINE>body.appendChild(maindl);<NEW_LINE>}
|
(htmldoc.createComment(MODIFICATION_WARNING));
|
108,707
|
public void run() {<NEW_LINE>try {<NEW_LINE>uploading = true;<NEW_LINE>removeAllLineHighlights();<NEW_LINE>if (serialMonitor != null) {<NEW_LINE>serialMonitor.suspend();<NEW_LINE>}<NEW_LINE>if (serialPlotter != null) {<NEW_LINE>serialPlotter.suspend();<NEW_LINE>}<NEW_LINE>boolean <MASK><NEW_LINE>if (success) {<NEW_LINE>statusNotice(tr("Done uploading."));<NEW_LINE>}<NEW_LINE>} catch (SerialNotFoundException e) {<NEW_LINE>if (portMenu.getItemCount() == 0) {<NEW_LINE>statusError(tr("Serial port not selected."));<NEW_LINE>} else {<NEW_LINE>if (serialPrompt()) {<NEW_LINE>run();<NEW_LINE>} else {<NEW_LINE>statusNotice(tr("Upload canceled."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (PreferencesMapException e) {<NEW_LINE>statusError(I18n.format(tr("Error while uploading: missing '{0}' configuration parameter"), e.getMessage()));<NEW_LINE>} catch (RunnerException e) {<NEW_LINE>// statusError("Error during upload.");<NEW_LINE>// e.printStackTrace();<NEW_LINE>status.unprogress();<NEW_LINE>statusError(e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>populatePortMenu();<NEW_LINE>avoidMultipleOperations = false;<NEW_LINE>}<NEW_LINE>status.unprogress();<NEW_LINE>uploading = false;<NEW_LINE>// toolbar.clear();<NEW_LINE>toolbar.deactivateExport();<NEW_LINE>resumeOrCloseSerialMonitor();<NEW_LINE>resumeOrCloseSerialPlotter();<NEW_LINE>base.onBoardOrPortChange();<NEW_LINE>}
|
success = sketchController.exportApplet(usingProgrammer);
|
178,968
|
void maybeReady() {<NEW_LINE>assertIsDispatchThread();<NEW_LINE>if (isReleased())<NEW_LINE>return;<NEW_LINE>boolean ready = isReady(true);<NEW_LINE>if (!ready)<NEW_LINE>return;<NEW_LINE>myRevalidatedObjects.clear();<NEW_LINE>setCancelRequested(false);<NEW_LINE>myResettingToReadyNow.set(false);<NEW_LINE>myInitialized.setDone();<NEW_LINE>if (canInitiateNewActivity()) {<NEW_LINE>if (myUpdaterState != null && !myUpdaterState.isProcessingNow()) {<NEW_LINE>UpdaterTreeState oldState = myUpdaterState;<NEW_LINE>if (!myUpdaterState.restore(null)) {<NEW_LINE>setUpdaterState(oldState);<NEW_LINE>}<NEW_LINE>if (!isReady(true))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setHoldSize(false);<NEW_LINE>if (myTree.isShowing()) {<NEW_LINE>if (getBuilder().isToEnsureSelectionOnFocusGained() && Registry.is("ide.tree.ensureSelectionOnFocusGained")) {<NEW_LINE>TreeUtil.ensureSelection(myTree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myInitialized.isDone()) {<NEW_LINE>if (isReleaseRequested() || isCancelProcessed()) {<NEW_LINE>myBusyObject.onReady(this);<NEW_LINE>} else {<NEW_LINE>myBusyObject.onReady();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (canInitiateNewActivity()) {<NEW_LINE>TreePath[] selection <MASK><NEW_LINE>Rectangle visible = getTree().getVisibleRect();<NEW_LINE>if (selection != null) {<NEW_LINE>for (TreePath each : selection) {<NEW_LINE>Rectangle bounds = getTree().getPathBounds(each);<NEW_LINE>if (bounds != null && (visible.contains(bounds) || visible.intersects(bounds))) {<NEW_LINE>getTree().repaint(bounds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
= getTree().getSelectionPaths();
|
940,527
|
private static void parseAttributes(String attributesInfo, JsonObject configuration) {<NEW_LINE>if (attributesInfo == null || attributesInfo.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>for (String parameterPair : attributesInfo.split("&")) {<NEW_LINE>if (parameterPair.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int indexOfDelimiter = parameterPair.indexOf("=");<NEW_LINE>if (indexOfDelimiter < 0) {<NEW_LINE>throw new IllegalArgumentException(format("Missing delimiter '=' of parameters \"%s\" in the part \"%s\"", attributesInfo, parameterPair));<NEW_LINE>} else {<NEW_LINE>String key = parameterPair.substring(<MASK><NEW_LINE>String value = decodeUrl(parameterPair.substring(indexOfDelimiter + 1).trim());<NEW_LINE>switch(key) {<NEW_LINE>case "port":<NEW_LINE>parsePort(value, configuration);<NEW_LINE>break;<NEW_LINE>case "host":<NEW_LINE>parseNetLocationValue(value, configuration);<NEW_LINE>break;<NEW_LINE>case "socket":<NEW_LINE>configuration.put("host", value);<NEW_LINE>break;<NEW_LINE>case "user":<NEW_LINE>configuration.put("user", value);<NEW_LINE>break;<NEW_LINE>case "password":<NEW_LINE>configuration.put("password", value);<NEW_LINE>break;<NEW_LINE>case "database":<NEW_LINE>configuration.put("database", value);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>configuration.put(key, value);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!properties.isEmpty()) {<NEW_LINE>configuration.put("properties", properties);<NEW_LINE>}<NEW_LINE>}
|
0, indexOfDelimiter).toLowerCase();
|
1,814,959
|
private void scheduleTasks() {<NEW_LINE>// Periodic save timer (Saves every 10 minutes by default)<NEW_LINE>long second = 20;<NEW_LINE>long minute = second * 60;<NEW_LINE>long saveIntervalTicks = Math.max(minute, generalConfig.getSaveInterval() * minute);<NEW_LINE>new SaveTimerTask().runTaskTimer(this, saveIntervalTicks, saveIntervalTicks);<NEW_LINE>// Cleanup the backups folder<NEW_LINE>new CleanBackupsTask().runTaskAsynchronously(mcMMO.p);<NEW_LINE>// Old & Powerless User remover<NEW_LINE>long purgeIntervalTicks = generalConfig.getPurgeInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;<NEW_LINE>if (purgeIntervalTicks == 0) {<NEW_LINE>// Start 2 seconds after startup.<NEW_LINE>new UserPurgeTask().runTaskLaterAsynchronously(this, 2 * Misc.TICK_CONVERSION_FACTOR);<NEW_LINE>} else if (purgeIntervalTicks > 0) {<NEW_LINE>new UserPurgeTask().runTaskTimerAsynchronously(this, purgeIntervalTicks, purgeIntervalTicks);<NEW_LINE>}<NEW_LINE>// Automatically remove old members from parties<NEW_LINE>long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;<NEW_LINE>if (kickIntervalTicks == 0) {<NEW_LINE>// Start 2 seconds after startup.<NEW_LINE>new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR);<NEW_LINE>} else if (kickIntervalTicks > 0) {<NEW_LINE>new PartyAutoKickTask().runTaskTimer(this, kickIntervalTicks, kickIntervalTicks);<NEW_LINE>}<NEW_LINE>// Update power level tag scoreboards<NEW_LINE>new PowerLevelUpdatingTask().runTaskTimer(this, 2 * Misc.<MASK><NEW_LINE>// Clear the registered XP data so players can earn XP again<NEW_LINE>if (ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {<NEW_LINE>new ClearRegisteredXPGainTask().runTaskTimer(this, 60, 60);<NEW_LINE>}<NEW_LINE>if (mcMMO.p.getAdvancedConfig().allowPlayerTips()) {<NEW_LINE>new NotifySquelchReminderTask().runTaskTimer(this, 60, ((20 * 60) * 60));<NEW_LINE>}<NEW_LINE>}
|
TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
|
1,378,047
|
public static void deleteGlobalFunctionComment(final AbstractSQLProvider provider, final INaviFunction function, final Integer commentId, final Integer userId) throws CouldntDeleteException {<NEW_LINE>Preconditions.checkNotNull(provider, "IE01243: provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(function, "IE01245: codeNode argument can not be null");<NEW_LINE>Preconditions.checkNotNull(commentId, "IE01247: comment argument can not be null");<NEW_LINE>Preconditions.checkNotNull(userId, "IE01308: userId argument can not be null");<NEW_LINE>final String deleteFunction = " { ? = call delete_function_comment(?, ?, ?, ?) } ";<NEW_LINE>try (CallableStatement deleteCommentStatement = provider.getConnection().getConnection().prepareCall(deleteFunction)) {<NEW_LINE>deleteCommentStatement.registerOutParameter(1, Types.INTEGER);<NEW_LINE>deleteCommentStatement.setInt(2, function.getModule().getConfiguration().getId());<NEW_LINE>deleteCommentStatement.setObject(3, function.getAddress().toBigInteger(), Types.BIGINT);<NEW_LINE>deleteCommentStatement.setInt(4, commentId);<NEW_LINE><MASK><NEW_LINE>deleteCommentStatement.execute();<NEW_LINE>deleteCommentStatement.getInt(1);<NEW_LINE>if (deleteCommentStatement.wasNull()) {<NEW_LINE>throw new IllegalArgumentException("Error: The comment id returned by the database was null");<NEW_LINE>}<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntDeleteException(exception);<NEW_LINE>}<NEW_LINE>}
|
deleteCommentStatement.setInt(5, userId);
|
789,964
|
public void doLeave(ActivityExecution execution) {<NEW_LINE>LOG.leavingActivity(execution.<MASK><NEW_LINE>PvmTransition outgoingSeqFlow = null;<NEW_LINE>String defaultSequenceFlow = (String) execution.getActivity().getProperty("default");<NEW_LINE>Iterator<PvmTransition> transitionIterator = execution.getActivity().getOutgoingTransitions().iterator();<NEW_LINE>while (outgoingSeqFlow == null && transitionIterator.hasNext()) {<NEW_LINE>PvmTransition seqFlow = transitionIterator.next();<NEW_LINE>Condition condition = (Condition) seqFlow.getProperty(BpmnParse.PROPERTYNAME_CONDITION);<NEW_LINE>if ((condition == null && (defaultSequenceFlow == null || !defaultSequenceFlow.equals(seqFlow.getId()))) || (condition != null && condition.evaluate(execution))) {<NEW_LINE>LOG.outgoingSequenceFlowSelected(seqFlow.getId());<NEW_LINE>outgoingSeqFlow = seqFlow;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outgoingSeqFlow != null) {<NEW_LINE>execution.leaveActivityViaTransition(outgoingSeqFlow);<NEW_LINE>} else {<NEW_LINE>if (defaultSequenceFlow != null) {<NEW_LINE>PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);<NEW_LINE>if (defaultTransition != null) {<NEW_LINE>execution.leaveActivityViaTransition(defaultTransition);<NEW_LINE>} else {<NEW_LINE>throw LOG.missingDefaultFlowException(execution.getActivity().getId(), defaultSequenceFlow);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// No sequence flow could be found, not even a default one<NEW_LINE>throw LOG.stuckExecutionException(execution.getActivity().getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
getActivity().getId());
|
839,962
|
// [9,6,-3,null,null,-6,2,null,null,2,null,-6,-6,-6]<NEW_LINE>private Result helper(TreeNode root) {<NEW_LINE>if (root == null) {<NEW_LINE>return new Result(0, Integer.MIN_VALUE);<NEW_LINE>}<NEW_LINE>if (root.left == null && root.right == null) {<NEW_LINE>return new Result(root.val, root.val);<NEW_LINE>}<NEW_LINE>Result left = helper(root.left);<NEW_LINE>Result <MASK><NEW_LINE>// @todo refactor the logic below<NEW_LINE>int sumToRoot = root.val;<NEW_LINE>int sumsOfSTR = Math.max(left.sumToRoot, right.sumToRoot);<NEW_LINE>if (sumsOfSTR > 0) {<NEW_LINE>sumToRoot = root.val + sumsOfSTR;<NEW_LINE>}<NEW_LINE>int sumOfTree = root.val + left.sumToRoot + right.sumToRoot;<NEW_LINE>int sumToLeft = root.val + left.sumToRoot;<NEW_LINE>int sumToRight = root.val + right.sumToRoot;<NEW_LINE>int max1 = Math.max(root.val, sumOfTree);<NEW_LINE>int max2 = Math.max(sumToLeft, sumToRight);<NEW_LINE>int max3 = Math.max(left.sumToLeaf, right.sumToLeaf);<NEW_LINE>int max4 = Math.max(max1, max2);<NEW_LINE>int max = Math.max(max3, max4);<NEW_LINE>return new Result(sumToRoot, max);<NEW_LINE>}
|
right = helper(root.right);
|
700,056
|
public void storeRecentLocations() {<NEW_LINE>Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeOWL.ID);<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>DefaultListModel model = ((DefaultListModel) recentLocations.getModel());<NEW_LINE>// Add in current file<NEW_LINE>if (getLocationURL() != null) {<NEW_LINE>File file = new File(getLocationURL()).getParentFile();<NEW_LINE>for (int i = 0; i < model.getSize(); i++) {<NEW_LINE>if (model.getElementAt(i).equals(file)) {<NEW_LINE>model.remove(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>model.add(0, file);<NEW_LINE>}<NEW_LINE>for (Object o : model.toArray()) {<NEW_LINE>File file = (File) o;<NEW_LINE><MASK><NEW_LINE>list.add(uri.toString());<NEW_LINE>}<NEW_LINE>prefs.putStringList(RECENT_LOCATIONS_KEY, list);<NEW_LINE>}
|
URI uri = file.toURI();
|
322,155
|
public void execute(NativeViewHierarchyManager nvhm) {<NEW_LINE>AirMapView view = (AirMapView) nvhm.resolveView(tag);<NEW_LINE>if (view == null) {<NEW_LINE>promise.reject("AirMapView not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (view.map == null) {<NEW_LINE>promise.reject("AirMapView.map is not valid");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (coordinate == null || !coordinate.hasKey("latitude") || !coordinate.hasKey("longitude")) {<NEW_LINE>promise.reject("Invalid coordinate format");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Geocoder geocoder = new Geocoder(context);<NEW_LINE>try {<NEW_LINE>List<Address> list = geocoder.getFromLocation(coordinate.getDouble("latitude"), coordinate.getDouble("longitude"), 1);<NEW_LINE>if (list.isEmpty()) {<NEW_LINE>promise.reject("Can not get address location");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Address address = list.get(0);<NEW_LINE>WritableMap addressJson = new WritableNativeMap();<NEW_LINE>addressJson.putString("name", address.getFeatureName());<NEW_LINE>addressJson.putString("locality", address.getLocality());<NEW_LINE>addressJson.putString("thoroughfare", address.getThoroughfare());<NEW_LINE>addressJson.putString("subThoroughfare", address.getSubThoroughfare());<NEW_LINE>addressJson.putString("subLocality", address.getSubLocality());<NEW_LINE>addressJson.putString("administrativeArea", address.getAdminArea());<NEW_LINE>addressJson.putString(<MASK><NEW_LINE>addressJson.putString("postalCode", address.getPostalCode());<NEW_LINE>addressJson.putString("countryCode", address.getCountryCode());<NEW_LINE>addressJson.putString("country", address.getCountryName());<NEW_LINE>promise.resolve(addressJson);<NEW_LINE>} catch (IOException e) {<NEW_LINE>promise.reject("Can not get address location");<NEW_LINE>}<NEW_LINE>}
|
"subAdministrativeArea", address.getSubAdminArea());
|
1,414,024
|
public void run() {<NEW_LINE>TokenSequence<CssTokenId> ts = LexerUtils.getJoinedTokenSequence(document, caretOffset, CssTokenId.language());<NEW_LINE>if (ts == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Token<CssTokenId> token = ts.token();<NEW_LINE>switch(token.id()) {<NEW_LINE>case STRING:<NEW_LINE>// check if there is @import token before<NEW_LINE>if (LexerUtils.followsToken(ts, CssTokenId.IMPORT_SYM, true, true, CssTokenId.WS, CssTokenId.NL) != null) {<NEW_LINE>int quotesDiff = WebUtils.isValueQuoted(ts.token().text().toString()) ? 1 : 0;<NEW_LINE>OffsetRange range = new OffsetRange(ts.offset() + quotesDiff, ts.offset() + ts.token(<MASK><NEW_LINE>result.set(range);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case URI:<NEW_LINE>Matcher m = Css3Utils.URI_PATTERN.matcher(ts.token().text());<NEW_LINE>if (m.matches()) {<NEW_LINE>int groupIndex = 1;<NEW_LINE>String value = m.group(groupIndex);<NEW_LINE>int quotesDiff = WebUtils.isValueQuoted(value) ? 1 : 0;<NEW_LINE>result.set(new OffsetRange(ts.offset() + m.start(groupIndex) + quotesDiff, ts.offset() + m.end(groupIndex) - quotesDiff));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
).length() - quotesDiff);
|
1,634,328
|
// Useful for monitoring and debugging<NEW_LINE>public boolean checkIntegrity() {<NEW_LINE>boolean integrity = true;<NEW_LINE>Double E = graphWeightSum;<NEW_LINE>Double e_in = communities.stream().mapToDouble(c -> c.internalWeightSum).sum();<NEW_LINE>Double e_out = E - e_in;<NEW_LINE>Double B = Double.valueOf(communities.size());<NEW_LINE>Double N = Double.valueOf(graph.getNodeCount());<NEW_LINE>// Check the integrity of nodeConnectionsWeight<NEW_LINE>double nodeComWeightSum = 0;<NEW_LINE>for (int node = 0; node < nodeConnectionsWeight.length; node++) {<NEW_LINE>HashMap<StatisticalInferenceClustering.Community, Float> hm = nodeConnectionsWeight[node];<NEW_LINE>Collection<Float> values = hm.values();<NEW_LINE>nodeComWeightSum += values.stream().mapToDouble(v -> (<MASK><NEW_LINE>}<NEW_LINE>// TODO: what should be done, in fact,<NEW_LINE>// is to check that for each node the sum of nodeConnectionsWeight<NEW_LINE>// equals its degree.<NEW_LINE>return integrity;<NEW_LINE>}
|
double) v).sum();
|
619,698
|
private <T> BsonDocument generateGauge(Gauge<T> gauge) {<NEW_LINE>try {<NEW_LINE>T value = gauge.getValue();<NEW_LINE>final BsonValue valueAsBson;<NEW_LINE>if (value instanceof Double) {<NEW_LINE>valueAsBson = new BsonDouble((Double) value);<NEW_LINE>} else if (value instanceof Float) {<NEW_LINE>valueAsBson = new BsonDouble((Float) value);<NEW_LINE>} else if (value instanceof Long) {<NEW_LINE>valueAsBson = new BsonInt64((Long) value);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>valueAsBson = new BsonInt32((Integer) value);<NEW_LINE>} else {<NEW_LINE>// returning a string is formally wrong here, but the best I can get for all the rest<NEW_LINE>valueAsBson = new BsonString(value.toString());<NEW_LINE>}<NEW_LINE>return new BsonDocument(<MASK><NEW_LINE>} catch (RuntimeException re) {<NEW_LINE>return new BsonDocument().append("error", new BsonString(re.toString()));<NEW_LINE>}<NEW_LINE>}
|
).append("value", valueAsBson);
|
710,354
|
public static RelNode convertLogicalSort(LogicalSort sort, RelNode input) {<NEW_LINE>final boolean hasOrdering = sort.withOrderBy();<NEW_LINE>final <MASK><NEW_LINE>if (hasOrdering && !hasLimit) {<NEW_LINE>RelDistribution relDistribution = sort.getTraitSet().getDistribution();<NEW_LINE>return convert(input, input.getTraitSet().replace(DrdsConvention.INSTANCE).replace(relDistribution).replace(sort.getCollation()));<NEW_LINE>} else if (hasOrdering && hasLimit) {<NEW_LINE>return Limit.create(sort.getTraitSet().replace(DrdsConvention.INSTANCE), convert(input, input.getTraitSet().replace(DrdsConvention.INSTANCE).replace(RelDistributions.SINGLETON).replace(sort.getCollation())), sort.offset, sort.fetch);<NEW_LINE>} else {<NEW_LINE>// !hasOrdering<NEW_LINE>return Limit.create(sort.getTraitSet().replace(DrdsConvention.INSTANCE).replace(RelDistributions.SINGLETON), input, sort.offset, sort.fetch);<NEW_LINE>}<NEW_LINE>}
|
boolean hasLimit = sort.withLimit();
|
1,486,864
|
private boolean hasSchemaAnnotationHandler() {<NEW_LINE>int expectedHandlersNumber = ((DefaultConfiguration) _handlerJarPath)<MASK><NEW_LINE>// skip if no handlers configured<NEW_LINE>if (expectedHandlersNumber == 0) {<NEW_LINE>getLogger().info("no schema annotation handlers configured for schema annotation compatibility check");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<URL> handlerJarPathUrls = SchemaAnnotationHandlerClassUtil.getAnnotationHandlerJarPathUrls(_handlerJarPath);<NEW_LINE>ClassLoader classLoader = new URLClassLoader(handlerJarPathUrls.toArray(new URL[handlerJarPathUrls.size()]), getClass().getClassLoader());<NEW_LINE>try {<NEW_LINE>_handlerClassNames = SchemaAnnotationHandlerClassUtil.getAnnotationHandlerClassNames(_handlerJarPath, classLoader, getProject());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new GradleException("Annotation compatibility check: could not get annotation handler class name. " + e.getMessage());<NEW_LINE>}<NEW_LINE>SchemaAnnotationHandlerClassUtil.checkAnnotationClassNumber(_handlerClassNames, expectedHandlersNumber);<NEW_LINE>return true;<NEW_LINE>}
|
.getAllDependencies().size();
|
1,748,301
|
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// Setting IpAddress To Log and taking header for original IP if forwarded from proxy<NEW_LINE>ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));<NEW_LINE>log.debug("*** servlets.Admin.GetFeedback ***");<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>request.setCharacterEncoding("UTF-8");<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>out.print(getServletInfo());<NEW_LINE>HttpSession ses = request.getSession(true);<NEW_LINE>Cookie tokenCookie = Validate.getToken(request.getCookies());<NEW_LINE>Object tokenParmeter = request.getParameter("csrfToken");<NEW_LINE>if (Validate.validateAdminSession(ses, tokenCookie, tokenParmeter)) {<NEW_LINE>ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());<NEW_LINE>if (Validate.validateTokens(tokenCookie, tokenParmeter)) {<NEW_LINE>String moduleId = Validate.validateParameter(request.getParameter("moduleId"), 64);<NEW_LINE>log.debug("moduleId: " + moduleId);<NEW_LINE>String ApplicationRoot = getServletContext().getRealPath("");<NEW_LINE>String htmlOutput = <MASK><NEW_LINE>if (htmlOutput.isEmpty()) {<NEW_LINE>htmlOutput = "No Feedback Found!";<NEW_LINE>}<NEW_LINE>out.write(htmlOutput);<NEW_LINE>} else {<NEW_LINE>out.write("Error Occurred!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("*** END servlets.Admin.GetFeedback ***");<NEW_LINE>}
|
Getter.getFeedback(ApplicationRoot, moduleId);
|
285,437
|
protected JComponent createCenterPanel() {<NEW_LINE>JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 10), 0, 0);<NEW_LINE>JLabel patternLabel = new JLabel<MASK><NEW_LINE>panel.add(patternLabel, gb);<NEW_LINE>Dimension oldPreferredSize = myPatternStringField.getPreferredSize();<NEW_LINE>myPatternStringField.setPreferredSize(new Dimension(300, oldPreferredSize.height));<NEW_LINE>gb.gridx = 1;<NEW_LINE>gb.gridwidth = GridBagConstraints.REMAINDER;<NEW_LINE>gb.weightx = 1;<NEW_LINE>panel.add(myPatternStringField, gb);<NEW_LINE>JLabel iconLabel = new JLabel(IdeBundle.message("label.todo.icon"));<NEW_LINE>gb.gridy++;<NEW_LINE>gb.gridx = 0;<NEW_LINE>gb.gridwidth = 1;<NEW_LINE>gb.weightx = 0;<NEW_LINE>panel.add(iconLabel, gb);<NEW_LINE>gb.gridx = 1;<NEW_LINE>gb.fill = GridBagConstraints.NONE;<NEW_LINE>gb.gridwidth = GridBagConstraints.REMAINDER;<NEW_LINE>gb.weightx = 0;<NEW_LINE>panel.add(myIconComboBox, gb);<NEW_LINE>gb.gridy++;<NEW_LINE>gb.gridx = 0;<NEW_LINE>gb.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>gb.gridwidth = GridBagConstraints.REMAINDER;<NEW_LINE>gb.weightx = 1;<NEW_LINE>panel.add(myCaseSensitiveCheckBox, gb);<NEW_LINE>gb.gridy++;<NEW_LINE>gb.gridx = 0;<NEW_LINE>gb.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>gb.gridwidth = GridBagConstraints.REMAINDER;<NEW_LINE>gb.weightx = 1;<NEW_LINE>panel.add(myUsedDefaultColorsCeckBox, gb);<NEW_LINE>gb.gridy++;<NEW_LINE>gb.gridx = 0;<NEW_LINE>gb.gridwidth = GridBagConstraints.REMAINDER;<NEW_LINE>gb.weightx = 1;<NEW_LINE>panel.add(myColorAndFontDescriptionPanel.getPanel(), gb);<NEW_LINE>return panel;<NEW_LINE>}
|
(IdeBundle.message("label.todo.pattern"));
|
500,473
|
public void rollFiles(final File file) {<NEW_LINE>File parent = file.getParentFile();<NEW_LINE>LogLog.debug("roll over folder -> " + parent.getAbsolutePath());<NEW_LINE>final Date removeDate = new Date(rc.getRemoveMillis(now, maxBackupIndex));<NEW_LINE>String[] removedFiles = parent.list(new FilenameFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>String logFilename = file.getName();<NEW_LINE>if (name.startsWith(logFilename)) {<NEW_LINE>String patternSuffix = name.substring(logFilename.length());<NEW_LINE>try {<NEW_LINE>Date <MASK><NEW_LINE>if (!parsedDate.after(removeDate) && sdf.format(parsedDate).equals(patternSuffix)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (ParseException e) {<NEW_LINE>// parse pattern suffix error<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < removedFiles.length; ++i) {<NEW_LINE>File removeTarget = new File(parent, removedFiles[i]);<NEW_LINE>if (removeTarget.exists()) {<NEW_LINE>removeTarget.delete();<NEW_LINE>LogLog.debug("remove " + removedFiles[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
parsedDate = sdf.parse(patternSuffix);
|
391,089
|
private void deletePartition(int partitionIndex) {<NEW_LINE>final int offset = partitionIndex * PARTITIONS_SLOT_SIZE;<NEW_LINE>long partitionTimestamp = openPartitionInfo.getQuick(offset);<NEW_LINE>long partitionSize = openPartitionInfo.getQuick(offset + PARTITIONS_SLOT_OFFSET_SIZE);<NEW_LINE>int columnBase = getColumnBase(partitionIndex);<NEW_LINE>if (partitionSize > -1L) {<NEW_LINE>for (int k = 0; k < columnCount; k++) {<NEW_LINE>closePartitionColumnFile(columnBase, k);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int baseIndex = getPrimaryColumnIndex(columnBase, 0);<NEW_LINE>int newBaseIndex = getPrimaryColumnIndex(getColumnBase(partitionIndex + 1), 0);<NEW_LINE>columns.remove(baseIndex, newBaseIndex - 1);<NEW_LINE>openPartitionInfo.removeIndexBlock(offset, PARTITIONS_SLOT_SIZE);<NEW_LINE>LOG.info().$("deleted partition [path=").$(path).$(",timestamp=").<MASK><NEW_LINE>partitionCount--;<NEW_LINE>}
|
$ts(partitionTimestamp).I$();
|
834,264
|
private void measureRoundTrip(final Histogram histogram, final InetSocketAddress sendAddress, final ByteBuffer buffer, final DatagramChannel sendChannel, final Selector selector, final AtomicBoolean running) throws IOException {<NEW_LINE>for (sequenceNumber = 0; sequenceNumber < Common.NUM_MESSAGES; sequenceNumber++) {<NEW_LINE>final long timestamp = System.nanoTime();<NEW_LINE>buffer.clear();<NEW_LINE>buffer.putLong(sequenceNumber);<NEW_LINE>buffer.putLong(timestamp);<NEW_LINE>buffer.flip();<NEW_LINE>sendChannel.send(buffer, sendAddress);<NEW_LINE>while (selector.selectNow() == 0) {<NEW_LINE>if (!running.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ThreadHints.onSpinWait();<NEW_LINE>}<NEW_LINE>final Set<SelectionKey> selectedKeys = selector.selectedKeys();<NEW_LINE>final Iterator<SelectionKey> iter = selectedKeys.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>final SelectionKey key = iter.next();<NEW_LINE>if (key.isReadable()) {<NEW_LINE>((IntSupplier) key.<MASK><NEW_LINE>}<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>histogram.outputPercentileDistribution(System.out, 1000.0);<NEW_LINE>}
|
attachment()).getAsInt();
|
262,416
|
private void toggleCollapsibleContent(final VH holder, final Item item, int lineCount) {<NEW_LINE>if (item.isContentExpanded() || lineCount <= mContentMaxLines) {<NEW_LINE>holder.mContentTextView.setMaxLines(Integer.MAX_VALUE);<NEW_LINE>holder.mReadMoreTextView.setVisibility(View.GONE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>holder.mContentTextView.setMaxLines(mContentMaxLines);<NEW_LINE>holder.mReadMoreTextView.setVisibility(View.VISIBLE);<NEW_LINE>holder.mReadMoreTextView.setText(mContext.getString(R<MASK><NEW_LINE>holder.mReadMoreTextView.setOnClickListener(v -> {<NEW_LINE>item.setContentExpanded(true);<NEW_LINE>v.setVisibility(View.GONE);<NEW_LINE>ObjectAnimator.ofInt(holder.mContentTextView, PROPERTY_MAX_LINES, lineCount).setDuration((lineCount - mContentMaxLines) * DURATION_PER_LINE_MILLIS).start();<NEW_LINE>});<NEW_LINE>}
|
.string.read_more, lineCount));
|
529,101
|
public void actionPerformedImpl(ActionEvent e, RTextArea textArea) {<NEW_LINE>try {<NEW_LINE>// find current color at caret<NEW_LINE>int caretPosition = textArea.getCaretPosition();<NEW_LINE>int start;<NEW_LINE>int len = 0;<NEW_LINE>String oldStr;<NEW_LINE>int[] <MASK><NEW_LINE>if (result != null) {<NEW_LINE>start = result[0];<NEW_LINE>len = result[1];<NEW_LINE>oldStr = textArea.getText(start, len);<NEW_LINE>} else {<NEW_LINE>start = caretPosition;<NEW_LINE>oldStr = "";<NEW_LINE>}<NEW_LINE>AtomicInteger length = new AtomicInteger(len);<NEW_LINE>AtomicBoolean changed = new AtomicBoolean();<NEW_LINE>// show pipette color picker<NEW_LINE>Window window = SwingUtilities.windowForComponent(textArea);<NEW_LINE>FlatColorPipette.pick(window, true, color -> {<NEW_LINE>// update editor immediately for live preview<NEW_LINE>String str = colorToString(color);<NEW_LINE>((FlatSyntaxTextArea) textArea).runWithoutUndo(() -> {<NEW_LINE>textArea.replaceRange(str, start, start + length.get());<NEW_LINE>});<NEW_LINE>length.set(str.length());<NEW_LINE>changed.set(true);<NEW_LINE>}, color -> {<NEW_LINE>// restore original string<NEW_LINE>((FlatSyntaxTextArea) textArea).runWithoutUndo(() -> {<NEW_LINE>textArea.replaceRange(oldStr, start, start + length.get());<NEW_LINE>});<NEW_LINE>length.set(oldStr.length());<NEW_LINE>// update editor<NEW_LINE>if (color != null) {<NEW_LINE>String newStr = colorToString(color);<NEW_LINE>try {<NEW_LINE>if (!newStr.equals(textArea.getText(start, length.get())))<NEW_LINE>textArea.replaceRange(newStr, start, start + length.get());<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (BadLocationException | IndexOutOfBoundsException | NumberFormatException | UnsupportedOperationException | AWTException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}
|
result = findColorAt(textArea, caretPosition);
|
1,507,505
|
public void testThrowExceptionInTxBMTTimeout() {<NEW_LINE>final String method = "testThrowExceptionInTxBMTTimeout";<NEW_LINE>ivBMTBean.prepThrowExceptionInTxBMTTimeout();<NEW_LINE>try {<NEW_LINE>svLogger.info("Waiting on latch for timer to expire for " + TimeoutFailureLocal.MAX_TIMER_WAIT + "ms");<NEW_LINE>TimeoutFailureBean.svResultsLatch.await(TimeoutFailureLocal.MAX_TIMER_WAIT, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>svLogger.logp(Level.WARNING, <MASK><NEW_LINE>}<NEW_LINE>int results = ivBMTBean.getResults();<NEW_LINE>switch(results) {<NEW_LINE>case TimeoutFailureLocal.RESULTS_NOT_RETRIED:<NEW_LINE>fail("Timeout method was never retried");<NEW_LINE>break;<NEW_LINE>case TimeoutFailureLocal.RESULTS_RETRIED_AS_EXPECTED:<NEW_LINE>// pass<NEW_LINE>break;<NEW_LINE>case TimeoutFailureLocal.RESULTS_BMT_TRAN_NOT_ROLLEDBACK:<NEW_LINE>fail("Timeout method with unresolved BMT transaction did not roll back as expected.");<NEW_LINE>default:<NEW_LINE>fail("Unexpected test condition");<NEW_LINE>}<NEW_LINE>}
|
CLASSNAME, method, "Unexpected exception during sleep", ex);
|
104,262
|
private static String detectDeclaredEncoding(byte[] data, String baseEncoding, int size) throws IOException {<NEW_LINE>char delimiter = '"';<NEW_LINE>String s = new String(data, 0, size, baseEncoding);<NEW_LINE>int iend = s.indexOf("?>");<NEW_LINE>iend = iend == -1 ? s.length() : iend;<NEW_LINE>int iestart = s.indexOf("encoding");<NEW_LINE>if (iestart == -1 || iestart > iend)<NEW_LINE>return null;<NEW_LINE>char[] chars = s.toCharArray();<NEW_LINE>int i = iestart;<NEW_LINE>for (; i < iend; i++) {<NEW_LINE>if (chars[i] == '=')<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (; i < iend; i++) {<NEW_LINE>if (chars[i] == '\'' || chars[i] == '"') {<NEW_LINE>delimiter = chars[i];<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>int ivalstart = i;<NEW_LINE>for (; i < iend; i++) {<NEW_LINE>if (chars[i] == delimiter) {<NEW_LINE>return new String(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
chars, ivalstart, i - ivalstart);
|
1,501,413
|
public void serialize(StringBody stringBody, JsonGenerator jgen, SerializerProvider provider) throws IOException {<NEW_LINE>boolean notFieldSetAndNotDefault = stringBody.getNot() != null && stringBody.getNot();<NEW_LINE>boolean optionalFieldSetAndNotDefault = stringBody.getOptional() != null && stringBody.getOptional();<NEW_LINE>boolean subStringFieldNotDefault = stringBody.isSubString();<NEW_LINE>boolean contentTypeFieldSet = stringBody.getContentType() != null;<NEW_LINE>if (serialiseDefaultValues || notFieldSetAndNotDefault || optionalFieldSetAndNotDefault || contentTypeFieldSet || subStringFieldNotDefault) {<NEW_LINE>jgen.writeStartObject();<NEW_LINE>if (notFieldSetAndNotDefault) {<NEW_LINE>jgen.writeBooleanField("not", true);<NEW_LINE>}<NEW_LINE>if (optionalFieldSetAndNotDefault) {<NEW_LINE>jgen.writeBooleanField("optional", true);<NEW_LINE>}<NEW_LINE>jgen.writeStringField("type", stringBody.getType().name());<NEW_LINE>jgen.writeStringField("string", stringBody.getValue());<NEW_LINE>if (subStringFieldNotDefault) {<NEW_LINE>jgen.writeBooleanField("subString", true);<NEW_LINE>}<NEW_LINE>if (contentTypeFieldSet) {<NEW_LINE>jgen.writeStringField("contentType", stringBody.getContentType());<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>} else {<NEW_LINE>jgen.<MASK><NEW_LINE>}<NEW_LINE>}
|
writeString(stringBody.getValue());
|
75,441
|
public final void releaseFromWrite(final OCacheEntry cacheEntry, final OWriteCache writeCache, final boolean changed) {<NEW_LINE>final OCachePointer cachePointer = cacheEntry.getCachePointer();<NEW_LINE>assert cachePointer != null;<NEW_LINE>final PageKey pageKey = new PageKey(cacheEntry.getFileId(<MASK><NEW_LINE>if (cacheEntry.isNewlyAllocatedPage() || changed) {<NEW_LINE>if (cacheEntry.isNewlyAllocatedPage()) {<NEW_LINE>cacheEntry.clearAllocationFlag();<NEW_LINE>}<NEW_LINE>data.compute(pageKey, (page, entry) -> {<NEW_LINE>writeCache.store(cacheEntry.getFileId(), cacheEntry.getPageIndex(), cacheEntry.getCachePointer());<NEW_LINE>// may be absent if page in pinned pages, in such case we use map as<NEW_LINE>return entry;<NEW_LINE>// virtual lock<NEW_LINE>});<NEW_LINE>cacheEntry.clearPageOperations();<NEW_LINE>}<NEW_LINE>// We need to release exclusive lock from cache pointer after we put it into the write cache so<NEW_LINE>// both "dirty pages" of write<NEW_LINE>// cache and write cache itself will contain actual values simultaneously. But because cache<NEW_LINE>// entry can be cleared after we put it back to the<NEW_LINE>// read cache we make copy of cache pointer before head.<NEW_LINE>//<NEW_LINE>// Following situation can happen, if we release exclusive lock before we put entry to the write<NEW_LINE>// cache.<NEW_LINE>// 1. Page is loaded for write, locked and related LSN is written to the "dirty pages" table.<NEW_LINE>// 2. Page lock is released.<NEW_LINE>// 3. Page is chosen to be flushed on disk and its entry removed from "dirty pages" table<NEW_LINE>// 4. Page is added to write cache as dirty<NEW_LINE>//<NEW_LINE>// So we have situation when page is added as dirty into the write cache but its related entry<NEW_LINE>// in "dirty pages" table is removed<NEW_LINE>// it is treated as flushed during fuzzy checkpoint and portion of write ahead log which<NEW_LINE>// contains not flushed changes is removed.<NEW_LINE>// This can lead to the data loss after restore and corruption of data structures<NEW_LINE>cachePointer.releaseExclusiveLock();<NEW_LINE>cacheEntry.releaseEntry();<NEW_LINE>}
|
), cacheEntry.getPageIndex());
|
1,137,411
|
public static FileStateValue createWithStatNoFollow(RootedPath rootedPath, FileStatusWithDigest statNoFollow, boolean digestWillBeInjected, XattrProvider xattrProvider, @Nullable TimestampGranularityMonitor tsgm) throws IOException {<NEW_LINE>Path path = rootedPath.asPath();<NEW_LINE>if (statNoFollow.isFile()) {<NEW_LINE>return statNoFollow.isSpecialFile() ? SpecialFileStateValue.fromStat(path.asFragment(), statNoFollow, tsgm) : RegularFileStateValue.fromPath(path, <MASK><NEW_LINE>} else if (statNoFollow.isDirectory()) {<NEW_LINE>return DIRECTORY_FILE_STATE_NODE;<NEW_LINE>} else if (statNoFollow.isSymbolicLink()) {<NEW_LINE>return new SymlinkFileStateValue(path.readSymbolicLinkUnchecked());<NEW_LINE>}<NEW_LINE>throw new InconsistentFilesystemException("according to stat, existing path " + path + " is " + "neither a file nor directory nor symlink.");<NEW_LINE>}
|
statNoFollow, digestWillBeInjected, xattrProvider, tsgm);
|
1,286,753
|
private Settings parseAsSettings() {<NEW_LINE>TomlValidator settingsTomlValidator;<NEW_LINE>try {<NEW_LINE>settingsTomlValidator = new TomlValidator(Schema.from(FileUtils.readFileAsString("settings-toml-schema.json")));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ProjectException("Failed to read the Settings.toml validator schema file.");<NEW_LINE>}<NEW_LINE>// Validate settingsToml using ballerina toml schema<NEW_LINE>settingsTomlValidator.validate(settingsToml.toml());<NEW_LINE>TomlTableNode tomlAstNode = settingsToml.toml().rootNode();<NEW_LINE>String host = "";<NEW_LINE>int port = 0;<NEW_LINE>String username = "";<NEW_LINE>String password = "";<NEW_LINE>String accessToken = "";<NEW_LINE>if (!tomlAstNode.entries().isEmpty()) {<NEW_LINE>TomlTableNode proxyNode = (TomlTableNode) tomlAstNode.entries().get(PROXY);<NEW_LINE>if (proxyNode != null && proxyNode.kind() != TomlType.NONE && proxyNode.kind() == TomlType.TABLE) {<NEW_LINE>host = getStringValueFromProxyNode(proxyNode, HOST, "");<NEW_LINE>port = getIntValueFromProxyNode(proxyNode, PORT, 0);<NEW_LINE>username = <MASK><NEW_LINE>password = getStringValueFromProxyNode(proxyNode, PASSWORD, "");<NEW_LINE>}<NEW_LINE>TomlTableNode centralNode = (TomlTableNode) tomlAstNode.entries().get(CENTRAL);<NEW_LINE>if (centralNode != null && centralNode.kind() != TomlType.NONE && centralNode.kind() == TomlType.TABLE) {<NEW_LINE>accessToken = getStringValueFromProxyNode(centralNode, ACCESS_TOKEN, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Settings.from(Proxy.from(host, port, username, password), Central.from(accessToken), diagnostics());<NEW_LINE>}
|
getStringValueFromProxyNode(proxyNode, USERNAME, "");
|
427,322
|
public void run(RegressionEnvironment env) {<NEW_LINE>// Assure destroy order ESPER-489<NEW_LINE>assertEquals(2, SupportPluginLoader.getNames().size());<NEW_LINE>assertEquals(2, SupportPluginLoader.getPostInitializes().size());<NEW_LINE>assertEquals("MyLoader", SupportPluginLoader.getNames().get(0));<NEW_LINE>assertEquals("MyLoader2", SupportPluginLoader.getNames().get(1));<NEW_LINE>assertEquals("val", SupportPluginLoader.getProps().get(<MASK><NEW_LINE>assertEquals("val2", SupportPluginLoader.getProps().get(1).get("name2"));<NEW_LINE>Object loader = getFromEnv(env, "plugin-loader/MyLoader");<NEW_LINE>assertTrue(loader instanceof SupportPluginLoader);<NEW_LINE>loader = getFromEnv(env, "plugin-loader/MyLoader2");<NEW_LINE>assertTrue(loader instanceof SupportPluginLoader);<NEW_LINE>SupportPluginLoader.getPostInitializes().clear();<NEW_LINE>SupportPluginLoader.getNames().clear();<NEW_LINE>env.runtime().initialize();<NEW_LINE>assertEquals(2, SupportPluginLoader.getPostInitializes().size());<NEW_LINE>assertEquals(2, SupportPluginLoader.getNames().size());<NEW_LINE>env.runtime().destroy();<NEW_LINE>assertEquals(2, SupportPluginLoader.getDestroys().size());<NEW_LINE>assertEquals("val2", SupportPluginLoader.getDestroys().get(0).get("name2"));<NEW_LINE>assertEquals("val", SupportPluginLoader.getDestroys().get(1).get("name"));<NEW_LINE>SupportPluginLoader.reset();<NEW_LINE>}
|
0).get("name"));
|
1,085,270
|
protected static void handleException(ActionType actionType, RestRequest request, RestChannel channel, Exception e) {<NEW_LINE>logger.debug(new ParameterizedMessage("{} failed for REST request [{}]", actionType, request.uri()), e);<NEW_LINE>final RestStatus <MASK><NEW_LINE>try {<NEW_LINE>channel.sendResponse(new BytesRestResponse(channel, restStatus, e) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean skipStackTrace() {<NEW_LINE>return restStatus == RestStatus.UNAUTHORIZED;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, List<String>> filterHeaders(Map<String, List<String>> headers) {<NEW_LINE>if (actionType != ActionType.RequestHandling || (restStatus == RestStatus.UNAUTHORIZED || restStatus == RestStatus.FORBIDDEN)) {<NEW_LINE>if (headers.containsKey("Warning")) {<NEW_LINE>headers = Maps.copyMapWithRemovedEntry(headers, "Warning");<NEW_LINE>}<NEW_LINE>if (headers.containsKey("X-elastic-product")) {<NEW_LINE>headers = Maps.copyMapWithRemovedEntry(headers, "X-elastic-product");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return headers;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception inner) {<NEW_LINE>inner.addSuppressed(e);<NEW_LINE>logger.error((Supplier<?>) () -> new ParameterizedMessage("failed to send failure response for uri [{}]", request.uri()), inner);<NEW_LINE>}<NEW_LINE>}
|
restStatus = ExceptionsHelper.status(e);
|
1,050,652
|
public void renameRollup(Database db, OlapTable table, RollupRenameClause renameClause) throws DdlException {<NEW_LINE>if (table.getState() != OlapTableState.NORMAL) {<NEW_LINE>throw new DdlException("Table[" + table.getName() + "] is under " + table.getState());<NEW_LINE>}<NEW_LINE>String rollupName = renameClause.getRollupName();<NEW_LINE>// check if it is base table name<NEW_LINE>if (rollupName.equals(table.getName())) {<NEW_LINE>throw new DdlException("Using ALTER TABLE RENAME to change table name");<NEW_LINE>}<NEW_LINE>String newRollupName = renameClause.getNewRollupName();<NEW_LINE>if (rollupName.equals(newRollupName)) {<NEW_LINE>throw new DdlException("Same rollup name");<NEW_LINE>}<NEW_LINE>Map<String, Long> indexNameToIdMap = table.getIndexNameToId();<NEW_LINE>if (indexNameToIdMap.get(rollupName) == null) {<NEW_LINE>throw new DdlException("Rollup index[" + rollupName + "] does not exists");<NEW_LINE>}<NEW_LINE>// check if name is already used<NEW_LINE>if (indexNameToIdMap.get(newRollupName) != null) {<NEW_LINE>throw new DdlException("Rollup name[" + newRollupName + "] is already used");<NEW_LINE>}<NEW_LINE>long indexId = indexNameToIdMap.remove(rollupName);<NEW_LINE><MASK><NEW_LINE>// log<NEW_LINE>TableInfo tableInfo = TableInfo.createForRollupRename(db.getId(), table.getId(), indexId, newRollupName);<NEW_LINE>editLog.logRollupRename(tableInfo);<NEW_LINE>LOG.info("rename rollup[{}] to {}", rollupName, newRollupName);<NEW_LINE>}
|
indexNameToIdMap.put(newRollupName, indexId);
|
1,459,211
|
protected static void displayCommandLineHelp(SelfExtractor extractor) {<NEW_LINE>// This method takes a SelfExtractor in case we want to tailor the help to the current archive<NEW_LINE>// Get the name of the JAR file to display in the command syntax");<NEW_LINE>String jarName = System.getProperty("sun.java.command", "wlp-liberty-developers-core.jar");<NEW_LINE>String[] s = jarName.split(" ");<NEW_LINE>jarName = s[0];<NEW_LINE>System.out.println("\n" + SelfExtract.format("usage"));<NEW_LINE>System.out.println("\njava -jar " + jarName + " [" + SelfExtract.format("options") + "] [" + SelfExtract.format("installLocation") + "]\n");<NEW_LINE>System.out.println(SelfExtract.format("options"));<NEW_LINE>System.out.println(" --acceptLicense");<NEW_LINE>System.out.println(" " + SelfExtract.format("helpAcceptLicense"));<NEW_LINE>System.out.println(" --verbose");<NEW_LINE>System.out.println(" " <MASK><NEW_LINE>System.out.println(" --viewLicenseAgreement");<NEW_LINE>System.out.println(" " + SelfExtract.format("helpAgreement"));<NEW_LINE>System.out.println(" --viewLicenseInfo");<NEW_LINE>System.out.println(" " + SelfExtract.format("helpInformation"));<NEW_LINE>if (extractor.isUserSample()) {<NEW_LINE>System.out.println(" --downloadDependencies");<NEW_LINE>System.out.println(" " + SelfExtract.format("helpDownloadDependencies"));<NEW_LINE>}<NEW_LINE>}
|
+ SelfExtract.format("helpVerbose"));
|
373,802
|
public static void renderTestReport(List<TestClassResult> testResults, File outputDir) {<NEW_LINE>GoTestResultsProvider provider = new GoTestResultsProvider(testResults);<NEW_LINE>try {<NEW_LINE>String executorClassName = isGradle4() ? "org.gradle.internal.operations.BuildOperationExecutor" : "org.gradle.internal.operations.BuildOperationProcessor";<NEW_LINE>String testReportClassName = isAfterGradle44() ? "org.gradle.api.internal.tasks.testing.report.DefaultTestReport" : "org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport";<NEW_LINE>Class buildOperationProcessorClass = Class.forName(executorClassName);<NEW_LINE>Class defaultTestReportClass = Class.forName(testReportClassName);<NEW_LINE>Constructor constructor = defaultTestReportClass.getConstructor(buildOperationProcessorClass);<NEW_LINE>Object buildOperationExecutor = Proxy.newProxyInstance(Gradle.class.getClassLoader(), new Class[] { <MASK><NEW_LINE>on(constructor.newInstance(buildOperationExecutor)).call("generateReport", provider, outputDir);<NEW_LINE>} catch (ReflectiveOperationException e) {<NEW_LINE>throw ExceptionHandler.uncheckException(e);<NEW_LINE>}<NEW_LINE>}
|
buildOperationProcessorClass }, new BuildOperationExecutorOrProcessor());
|
1,378,596
|
static <T> T convertTo(@NonNull String value, @NonNull Class<T> type) {<NEW_LINE>Assert.notNull(value, "Value must not be null");<NEW_LINE>Assert.notNull(type, "Type must not be null");<NEW_LINE>if (type.isAssignableFrom(String.class)) {<NEW_LINE>return (T) value;<NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Integer.class)) {<NEW_LINE>return (T) Integer.valueOf(value);<NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Long.class)) {<NEW_LINE>return (T) Long.valueOf(value);<NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Boolean.class)) {<NEW_LINE>return (<MASK><NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Short.class)) {<NEW_LINE>return (T) Short.valueOf(value);<NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Byte.class)) {<NEW_LINE>return (T) Byte.valueOf(value);<NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Double.class)) {<NEW_LINE>return (T) Double.valueOf(value);<NEW_LINE>}<NEW_LINE>if (type.isAssignableFrom(Float.class)) {<NEW_LINE>return (T) Float.valueOf(value);<NEW_LINE>}<NEW_LINE>// Should never happen<NEW_LINE>throw new UnsupportedOperationException("Unsupported convention for blog property type:" + type.getName() + " provided");<NEW_LINE>}
|
T) Boolean.valueOf(value);
|
1,347,325
|
public okhttp3.Call readNamespacedDeploymentCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
|
HashMap<String, String>();
|
1,290,137
|
public void verifyCertificatesSubject(ServerNames serverNames, InetSocketAddress peer, X509Certificate certificate) throws HandshakeException {<NEW_LINE>if (certificate == null) {<NEW_LINE>throw new NullPointerException("Certficate must not be null!");<NEW_LINE>}<NEW_LINE>if (serverNames == null && peer == null) {<NEW_LINE>// nothing to verify<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String literalIp = null;<NEW_LINE>String hostname = null;<NEW_LINE>if (peer != null) {<NEW_LINE>hostname = StringUtil.toHostString(peer);<NEW_LINE><MASK><NEW_LINE>if (destination != null) {<NEW_LINE>literalIp = destination.getHostAddress();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (serverNames != null) {<NEW_LINE>ServerName serverName = serverNames.getServerName(ServerName.NameType.HOST_NAME);<NEW_LINE>if (serverName != null) {<NEW_LINE>hostname = serverName.getNameAsString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hostname != null && hostname.equals(literalIp)) {<NEW_LINE>hostname = null;<NEW_LINE>}<NEW_LINE>if (hostname != null) {<NEW_LINE>if (!CertPathUtil.matchDestination(certificate, hostname)) {<NEW_LINE>String cn = CertPathUtil.getSubjectsCn(certificate);<NEW_LINE>LOGGER.debug("Certificate {} validation failed: destination doesn't match", cn);<NEW_LINE>AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.BAD_CERTIFICATE);<NEW_LINE>throw new HandshakeException("Certificate " + cn + ": Destination '" + hostname + "' doesn't match!", alert);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!CertPathUtil.matchLiteralIP(certificate, literalIp)) {<NEW_LINE>String cn = CertPathUtil.getSubjectsCn(certificate);<NEW_LINE>LOGGER.debug("Certificate {} validation failed: literal IP doesn't match", cn);<NEW_LINE>AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.BAD_CERTIFICATE);<NEW_LINE>throw new HandshakeException("Certificate " + cn + ": Literal IP " + literalIp + " doesn't match!", alert);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
InetAddress destination = peer.getAddress();
|
1,746,971
|
protected JDialog createDialog(Component parent) throws HeadlessException {<NEW_LINE>FileChooserUI ui = getUI();<NEW_LINE>String title = ui.getDialogTitle(this);<NEW_LINE>putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY, title);<NEW_LINE>JDialog dialog;<NEW_LINE>Window window = getWindowForComponent(parent);<NEW_LINE>if (window instanceof Frame) {<NEW_LINE>dialog = new JDialog((<MASK><NEW_LINE>} else {<NEW_LINE>dialog = new JDialog((Dialog) window, title, true);<NEW_LINE>}<NEW_LINE>dialog.setComponentOrientation(this.getComponentOrientation());<NEW_LINE>Container contentPane = dialog.getContentPane();<NEW_LINE>contentPane.setLayout(new BorderLayout());<NEW_LINE>contentPane.add(this, BorderLayout.CENTER);<NEW_LINE>if (JDialog.isDefaultLookAndFeelDecorated()) {<NEW_LINE>boolean supportsWindowDecorations = UIManager.getLookAndFeel().getSupportsWindowDecorations();<NEW_LINE>if (supportsWindowDecorations) {<NEW_LINE>dialog.getRootPane().setWindowDecorationStyle(JRootPane.FILE_CHOOSER_DIALOG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dialog.getRootPane().setDefaultButton(ui.getDefaultButton(this));<NEW_LINE>dialog.pack();<NEW_LINE>dialog.setLocationRelativeTo(parent);<NEW_LINE>return dialog;<NEW_LINE>}
|
Frame) window, title, true);
|
1,822,906
|
protected boolean processNode(Node node, PEReadEliminationBlockState state, GraphEffectList effects, FixedWithNextNode lastFixedNode) {<NEW_LINE>if (super.processNode(node, state, effects, lastFixedNode)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (currentMode != EffectsClosureMode.REGULAR_VIRTUALIZATION) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (node instanceof LoadFieldNode) {<NEW_LINE>return processLoadField((LoadFieldNode) node, state, effects);<NEW_LINE>} else if (node instanceof StoreFieldNode) {<NEW_LINE>return processStoreField((StoreFieldNode) node, state, effects);<NEW_LINE>} else if (node instanceof LoadIndexedNode) {<NEW_LINE>return processLoadIndexed((LoadIndexedNode) node, state, effects);<NEW_LINE>} else if (node instanceof StoreIndexedNode) {<NEW_LINE>return processStoreIndexed((StoreIndexedNode) node, state, effects);<NEW_LINE>} else if (node instanceof ArrayLengthNode) {<NEW_LINE>return processArrayLength((ArrayLengthNode) node, state, effects);<NEW_LINE>} else if (node instanceof UnboxNode) {<NEW_LINE>return processUnbox((UnboxNode) node, state, effects);<NEW_LINE>} else if (node instanceof RawLoadNode) {<NEW_LINE>return processUnsafeLoad((RawLoadNode) node, state, effects);<NEW_LINE>} else if (node instanceof RawStoreNode) {<NEW_LINE>return processUnsafeStore((<MASK><NEW_LINE>} else if (node instanceof SingleMemoryKill) {<NEW_LINE>COUNTER_MEMORYCHECKPOINT.increment(node.getDebug());<NEW_LINE>LocationIdentity identity = ((SingleMemoryKill) node).getKilledLocationIdentity();<NEW_LINE>processIdentity(state, identity);<NEW_LINE>} else if (node instanceof MultiMemoryKill) {<NEW_LINE>COUNTER_MEMORYCHECKPOINT.increment(node.getDebug());<NEW_LINE>for (LocationIdentity identity : ((MultiMemoryKill) node).getKilledLocationIdentities()) {<NEW_LINE>processIdentity(state, identity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
RawStoreNode) node, state, effects);
|
163,755
|
private void init(Context context, AttributeSet attrs) {<NEW_LINE>TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.SmoothCheckBox);<NEW_LINE>int tickColor = ThemeStore.accentColor(context);<NEW_LINE>mCheckedColor = context.getResources().getColor(R.color.background_card);<NEW_LINE>mUnCheckedColor = context.getResources().getColor(R.color.background_menu);<NEW_LINE>mFloorColor = context.getResources().getColor(R.color.transparent30);<NEW_LINE>tickColor = ta.getColor(R.styleable.SmoothCheckBox_color_tick, tickColor);<NEW_LINE>mAnimDuration = ta.getInt(R.styleable.SmoothCheckBox_duration, DEF_ANIM_DURATION);<NEW_LINE>mFloorColor = ta.getColor(R.styleable.SmoothCheckBox_color_unchecked_stroke, mFloorColor);<NEW_LINE>mCheckedColor = ta.getColor(R.styleable.SmoothCheckBox_color_checked, mCheckedColor);<NEW_LINE>mUnCheckedColor = ta.getColor(R.styleable.SmoothCheckBox_color_unchecked, mUnCheckedColor);<NEW_LINE>mStrokeWidth = ta.getDimensionPixelSize(R.styleable.SmoothCheckBox_stroke_width, DensityUtil.dp2px(getContext(), 0));<NEW_LINE>ta.recycle();<NEW_LINE>mFloorUnCheckedColor = mFloorColor;<NEW_LINE>mTickPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>mTickPaint.setStyle(Paint.Style.STROKE);<NEW_LINE>mTickPaint.setStrokeCap(Paint.Cap.ROUND);<NEW_LINE>mTickPaint.setColor(tickColor);<NEW_LINE>mFloorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>mFloorPaint.setStyle(Paint.Style.FILL);<NEW_LINE>mFloorPaint.setColor(mFloorColor);<NEW_LINE>mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>mPaint.<MASK><NEW_LINE>mPaint.setColor(mCheckedColor);<NEW_LINE>mTickPath = new Path();<NEW_LINE>mCenterPoint = new Point();<NEW_LINE>mTickPoints = new Point[3];<NEW_LINE>mTickPoints[0] = new Point();<NEW_LINE>mTickPoints[1] = new Point();<NEW_LINE>mTickPoints[2] = new Point();<NEW_LINE>setOnClickListener(v -> {<NEW_LINE>toggle();<NEW_LINE>mTickDrawing = false;<NEW_LINE>mDrewDistance = 0;<NEW_LINE>if (isChecked()) {<NEW_LINE>startCheckedAnimation();<NEW_LINE>} else {<NEW_LINE>startUnCheckedAnimation();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
setStyle(Paint.Style.FILL);
|
1,619,517
|
public synchronized boolean init(final PlacementDriverServerOptions opts) {<NEW_LINE>if (this.started) {<NEW_LINE>LOG.info("[PlacementDriverServer] already started.");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final RheaKVStoreOptions rheaOpts = opts.getRheaKVStoreOptions();<NEW_LINE>Requires.requireNonNull(rheaOpts, "opts.rheaKVStoreOptions");<NEW_LINE>this.rheaKVStore = new DefaultRheaKVStore();<NEW_LINE>if (!this.rheaKVStore.init(rheaOpts)) {<NEW_LINE>LOG.error("Fail to init [RheaKVStore].");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>this.placementDriverService = new DefaultPlacementDriverService(this.rheaKVStore);<NEW_LINE>if (!this.placementDriverService.init(opts)) {<NEW_LINE>LOG.error("Fail to init [PlacementDriverService].");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final StoreEngine storeEngine = ((DefaultRheaKVStore) this.rheaKVStore).getStoreEngine();<NEW_LINE>Requires.requireNonNull(storeEngine, "storeEngine");<NEW_LINE>final List<RegionEngine> regionEngines = storeEngine.getAllRegionEngines();<NEW_LINE>if (regionEngines.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Non region for [PlacementDriverServer]");<NEW_LINE>}<NEW_LINE>if (regionEngines.size() > 1) {<NEW_LINE>throw new IllegalArgumentException("Only support single region for [PlacementDriverServer]");<NEW_LINE>}<NEW_LINE>this.regionEngine = regionEngines.get(0);<NEW_LINE>this.rheaKVStore.addLeaderStateListener(this.regionEngine.getRegion().getId(), ((DefaultPlacementDriverService) this.placementDriverService));<NEW_LINE>addPlacementDriverProcessor(storeEngine.getRpcServer());<NEW_LINE>LOG.info("[PlacementDriverServer] start successfully, options: {}.", opts);<NEW_LINE>return this.started = true;<NEW_LINE>}
|
Requires.requireNonNull(opts, "opts");
|
179,628
|
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>List<Wo> wos = emc.fetchAll(Application.class, Wo.copier);<NEW_LINE>List<WrapProcess> processList = emc.fetchAll(Process.class, processCopier);<NEW_LINE>processList.stream().forEach(o -> {<NEW_LINE>if (StringUtils.isEmpty(o.getEdition())) {<NEW_LINE>o.setName(o.getName() + "_V1.0");<NEW_LINE>} else {<NEW_LINE>o.setName(o.getEditionName());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>processList = processList.stream().sorted(Comparator.comparing(WrapProcess::getName, Comparator.nullsLast(String::compareTo))).<MASK><NEW_LINE>List<WrapForm> formList = emc.fetchAll(Form.class, formCopier);<NEW_LINE>List<WrapScript> scriptList = emc.fetchAll(Script.class, scriptCopier);<NEW_LINE>List<WrapFile> fileList = emc.fetchAll(File.class, fileCopier);<NEW_LINE>List<WrapApplicationDict> applicationDictList = emc.fetchAll(ApplicationDict.class, applicationDictCopier);<NEW_LINE>ListTools.groupStick(wos, processList, Application.id_FIELDNAME, Process.application_FIELDNAME, "processList");<NEW_LINE>ListTools.groupStick(wos, formList, Application.id_FIELDNAME, Form.application_FIELDNAME, "formList");<NEW_LINE>ListTools.groupStick(wos, scriptList, Application.id_FIELDNAME, Script.application_FIELDNAME, "scriptList");<NEW_LINE>ListTools.groupStick(wos, fileList, Application.id_FIELDNAME, File.application_FIELDNAME, "fileList");<NEW_LINE>ListTools.groupStick(wos, applicationDictList, Application.id_FIELDNAME, ApplicationDict.application_FIELDNAME, "applicationDictList");<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(Wo::getAlias, Comparator.nullsLast(String::compareTo)).thenComparing(Wo::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
|
collect(Collectors.toList());
|
582,352
|
public void initView() {<NEW_LINE>Array<AttributeVO> gridAttributes = new Array<>();<NEW_LINE>gridAttributes.add(new AttributeVO("Width", currentParameters.gridWidth));<NEW_LINE>gridAttributes.add(new AttributeVO("Height", currentParameters.gridHeight));<NEW_LINE>CategoryVO gridVO = new CategoryVO("Grid size: ", gridAttributes);<NEW_LINE>grid = new Category(gridVO);<NEW_LINE>content.add(grid).expandX().colspan(2).padTop(10).left().top().row();<NEW_LINE>panel.tiledPlugin.dataToSave.setParameterVO(currentParameters);<NEW_LINE>VisTextButton okBtn = new VisTextButton("Save");<NEW_LINE>content.add(okBtn).width(70).pad(20).colspan(2).expandX().center().bottom().row();<NEW_LINE>okBtn.addListener(new ClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void clicked(InputEvent event, float x, float y) {<NEW_LINE>super.clicked(event, x, y);<NEW_LINE>currentParameters.gridWidth = grid.getAttributeVO("Width: ").value;<NEW_LINE>currentParameters.gridHeight = grid.getAttributeVO("Height: ").value;<NEW_LINE>panel.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
facade.sendNotification(OK_BTN_CLICKED, currentParameters);
|
26,811
|
private HttpPipeline createHttpPipeline() {<NEW_LINE>Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;<NEW_LINE>if (httpLogOptions == null) {<NEW_LINE>httpLogOptions = new HttpLogOptions();<NEW_LINE>}<NEW_LINE>List<HttpPipelinePolicy> policies = new ArrayList<>();<NEW_LINE>String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");<NEW_LINE>String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");<NEW_LINE>policies.add(new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration));<NEW_LINE>HttpPolicyProviders.addBeforeRetryPolicies(policies);<NEW_LINE>policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);<NEW_LINE>policies.add(new CookiePolicy());<NEW_LINE><MASK><NEW_LINE>HttpPolicyProviders.addAfterRetryPolicies(policies);<NEW_LINE>policies.add(new HttpLoggingPolicy(httpLogOptions));<NEW_LINE>return new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])).httpClient(httpClient).build();<NEW_LINE>}
|
policies.addAll(this.pipelinePolicies);
|
908,925
|
public static AcceptableMediaType valueOf(HttpHeaderReader reader) throws ParseException {<NEW_LINE>// Skip any white space<NEW_LINE>reader.hasNext();<NEW_LINE>// Get the type<NEW_LINE>String type = reader.nextToken().toString();<NEW_LINE>String subType = "*";<NEW_LINE>// Some HTTP implements use "*" to mean "*/*"<NEW_LINE>if (reader.hasNextSeparator('/', false)) {<NEW_LINE>reader.next(false);<NEW_LINE>// Get the subtype<NEW_LINE>subType = reader<MASK><NEW_LINE>}<NEW_LINE>Map<String, String> parameters = null;<NEW_LINE>int quality = Quality.DEFAULT;<NEW_LINE>if (reader.hasNext()) {<NEW_LINE>parameters = HttpHeaderReader.readParameters(reader);<NEW_LINE>if (parameters != null) {<NEW_LINE>String v = parameters.get(Quality.QUALITY_PARAMETER_NAME);<NEW_LINE>if (v != null) {<NEW_LINE>quality = HttpHeaderReader.readQualityFactor(v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// use private constructor to skip quality value validation step<NEW_LINE>return new AcceptableMediaType(type, subType, parameters, quality);<NEW_LINE>}
|
.nextToken().toString();
|
932,017
|
private DatabaseTransactionLogModule buildTransactionLogs(LogFiles logFiles, Config config, LogProvider logProvider, JobScheduler scheduler, CheckPointerImpl.ForceOperation forceOperation, LogEntryReader logEntryReader, MetadataProvider metadataProvider, Monitors monitors, Dependencies databaseDependencies) {<NEW_LINE>TransactionMetadataCache transactionMetadataCache = new TransactionMetadataCache();<NEW_LINE>Lock pruneLock = new ReentrantLock();<NEW_LINE>final LogPruning logPruning = new LogPruningImpl(fs, logFiles, logProvider, new LogPruneStrategyFactory(), clock, config, pruneLock);<NEW_LINE>var transactionAppender = createTransactionAppender(logFiles, metadataProvider, transactionMetadataCache, config, databaseHealth, scheduler, logProvider);<NEW_LINE>life.add(transactionAppender);<NEW_LINE>final LogicalTransactionStore logicalTransactionStore = new PhysicalLogicalTransactionStore(logFiles, transactionMetadataCache, logEntryReader, monitors, true, config);<NEW_LINE>CheckPointThreshold threshold = CheckPointThreshold.createThreshold(config, clock, logPruning, logProvider);<NEW_LINE>var checkpointAppender = logFiles.getCheckpointFile().getCheckpointAppender();<NEW_LINE>final CheckPointerImpl checkPointer = new CheckPointerImpl(metadataProvider, threshold, forceOperation, logPruning, checkpointAppender, databaseHealth, logProvider, tracers, ioController, storeCopyCheckPointMutex, versionContextSupplier, clock);<NEW_LINE>long recurringPeriod = threshold.checkFrequencyMillis();<NEW_LINE>CheckPointScheduler checkPointScheduler = new CheckPointScheduler(checkPointer, ioController, scheduler, recurringPeriod, databaseHealth, namedDatabaseId.name());<NEW_LINE>life.add(checkPointer);<NEW_LINE>life.add(checkPointScheduler);<NEW_LINE>TransactionLogServiceImpl transactionLogService = new TransactionLogServiceImpl(metadataProvider, logFiles, logicalTransactionStore, pruneLock, databaseAvailabilityGuard);<NEW_LINE>databaseDependencies.satisfyDependencies(checkPointer, logFiles, logicalTransactionStore, transactionAppender, transactionLogService);<NEW_LINE><MASK><NEW_LINE>}
|
return new DatabaseTransactionLogModule(checkPointer, transactionAppender);
|
1,317,015
|
private TaskProvider<BootWar> configureBootWarTask(Project project) {<NEW_LINE>Configuration developmentOnly = project.getConfigurations().getByName(SpringBootPlugin.DEVELOPMENT_ONLY_CONFIGURATION_NAME);<NEW_LINE>Configuration productionRuntimeClasspath = project.getConfigurations(<MASK><NEW_LINE>Callable<FileCollection> classpath = () -> project.getExtensions().getByType(SourceSetContainer.class).getByName(SourceSet.MAIN_SOURCE_SET_NAME).getRuntimeClasspath().minus(providedRuntimeConfiguration(project)).minus((developmentOnly.minus(productionRuntimeClasspath))).filter(new JarTypeFileSpec());<NEW_LINE>TaskProvider<ResolveMainClassName> resolveMainClassName = project.getTasks().named(SpringBootPlugin.RESOLVE_MAIN_CLASS_NAME_TASK_NAME, ResolveMainClassName.class);<NEW_LINE>TaskProvider<BootWar> bootWarProvider = project.getTasks().register(SpringBootPlugin.BOOT_WAR_TASK_NAME, BootWar.class, (bootWar) -> {<NEW_LINE>bootWar.setGroup(BasePlugin.BUILD_GROUP);<NEW_LINE>bootWar.setDescription("Assembles an executable war archive containing webapp" + " content, and the main classes and their dependencies.");<NEW_LINE>bootWar.providedClasspath(providedRuntimeConfiguration(project));<NEW_LINE>bootWar.setClasspath(classpath);<NEW_LINE>Provider<String> manifestStartClass = project.provider(() -> (String) bootWar.getManifest().getAttributes().get("Start-Class"));<NEW_LINE>bootWar.getMainClass().convention(resolveMainClassName.flatMap((resolver) -> manifestStartClass.isPresent() ? manifestStartClass : resolveMainClassName.get().readMainClassName()));<NEW_LINE>});<NEW_LINE>bootWarProvider.map((bootWar) -> bootWar.getClasspath());<NEW_LINE>return bootWarProvider;<NEW_LINE>}
|
).getByName(SpringBootPlugin.PRODUCTION_RUNTIME_CLASSPATH_CONFIGURATION_NAME);
|
794,557
|
public IAllocationRequest requestQtyToAllocate(final IAllocationRequest request) {<NEW_LINE>assertQtyAllocationDeallocationAllowed();<NEW_LINE>// Check: Qty shall be positive or zero<NEW_LINE>final <MASK><NEW_LINE>Check.assume(qtyRequired.signum() >= 0, "qtyRequired({}) >= 0", qtyRequired);<NEW_LINE>//<NEW_LINE>// Zero Qty Request: return the request right away, there is nothing to do (optimization)<NEW_LINE>if (qtyRequired.signum() == 0) {<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Force allocation: don't check if we have enough qty<NEW_LINE>if (checkForceQtyAllocation(request)) {<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>final ProductId productId = request.getProductId();<NEW_LINE>final I_C_UOM uom = request.getC_UOM();<NEW_LINE>final Capacity availableCapacityDefinition = getAvailableCapacity(productId, uom, request.getDate());<NEW_LINE>//<NEW_LINE>// Infinite capacity check<NEW_LINE>if (availableCapacityDefinition.isInfiniteCapacity()) {<NEW_LINE>// Corner case: qty to allocate is infinite and capacity is also infinite => not allowed<NEW_LINE>if (request.isInfiniteQty()) {<NEW_LINE>throw new HUInfiniteQtyAllocationException(request, this);<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>final BigDecimal capacityAvailable = availableCapacityDefinition.toBigDecimal();<NEW_LINE>if (capacityAvailable.signum() == 0) {<NEW_LINE>return AllocationUtils.createZeroQtyRequest(request);<NEW_LINE>}<NEW_LINE>if (capacityAvailable.compareTo(qtyRequired) >= 0) {<NEW_LINE>return request;<NEW_LINE>} else {<NEW_LINE>return AllocationUtils.createQtyRequest(request, capacityAvailable);<NEW_LINE>}<NEW_LINE>}
|
BigDecimal qtyRequired = request.getQty();
|
1,191,891
|
private ReferenceDB addRef(Address fromAddr, Address toAddr, RefType type, SourceType sourceType, int opIndex, boolean isOffset, boolean isShifted, long offsetOrShift) throws IOException {<NEW_LINE>if (isOffset && isShifted) {<NEW_LINE>throw new IllegalArgumentException("Reference may not be both shifted and offset");<NEW_LINE>}<NEW_LINE>if (opIndex < Reference.MNEMONIC) {<NEW_LINE>throw new IllegalArgumentException("Invalid opIndex specified: " + opIndex);<NEW_LINE>}<NEW_LINE>if (toAddr.getAddressSpace().isOverlaySpace()) {<NEW_LINE>toAddr = ((OverlayAddressSpace) toAddr.getAddressSpace<MASK><NEW_LINE>}<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>boolean isPrimary = false;<NEW_LINE>ReferenceDB oldRef = (ReferenceDB) getReference(fromAddr, toAddr, opIndex);<NEW_LINE>if (oldRef != null) {<NEW_LINE>if (!isIncompatible(oldRef, isOffset, isShifted, offsetOrShift)) {<NEW_LINE>type = combineReferenceType(type, oldRef.getReferenceType());<NEW_LINE>if (type == oldRef.getReferenceType()) {<NEW_LINE>return oldRef;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>removeReference(fromAddr, toAddr, opIndex);<NEW_LINE>isPrimary = oldRef.isPrimary();<NEW_LINE>}<NEW_LINE>boolean isStackRegisterRef = toAddr.isStackAddress() || toAddr.isRegisterAddress();<NEW_LINE>RefList fromRefs = getFromRefs(fromAddr);<NEW_LINE>RefList toRefs = null;<NEW_LINE>if (!isStackRegisterRef) {<NEW_LINE>toRefs = getToRefs(toAddr);<NEW_LINE>}<NEW_LINE>// make the 1st reference primary...<NEW_LINE>isPrimary |= fromRefs == null || (fromAddr.isMemoryAddress() && !fromRefs.hasReference(opIndex));<NEW_LINE>if (fromRefs == null) {<NEW_LINE>fromRefs = fromAdapter.createRefList(program, fromCache, fromAddr);<NEW_LINE>}<NEW_LINE>fromRefs = fromRefs.checkRefListSize(fromCache, 1);<NEW_LINE>fromRefs.addRef(fromAddr, toAddr, type, opIndex, -1, isPrimary, sourceType, isOffset, isShifted, offsetOrShift);<NEW_LINE>if (toRefs == null && !isStackRegisterRef) {<NEW_LINE>toRefs = toAdapter.createRefList(program, toCache, toAddr);<NEW_LINE>}<NEW_LINE>if (toRefs != null) {<NEW_LINE>toRefs = toRefs.checkRefListSize(toCache, 1);<NEW_LINE>toRefs.addRef(fromAddr, toAddr, type, opIndex, -1, isPrimary, sourceType, isOffset, isShifted, offsetOrShift);<NEW_LINE>}<NEW_LINE>ReferenceDB r = toRefs == null || fromRefs.getNumRefs() < toRefs.getNumRefs() ? fromRefs.getRef(toAddr, opIndex) : toRefs.getRef(fromAddr, opIndex);<NEW_LINE>referenceAdded(r);<NEW_LINE>return r;<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>}
|
()).translateAddress(toAddr);
|
941,341
|
private void renderStream(Context context, Publisher<? extends ServerSentEvent> events) {<NEW_LINE>Response response = context.getResponse();<NEW_LINE>response.getHeaders().add(HttpHeaderConstants.CONTENT_TYPE, HttpHeaderConstants.TEXT_EVENT_STREAM_CHARSET_UTF_8);<NEW_LINE>response.getHeaders().add(<MASK><NEW_LINE>ByteBufAllocator byteBufAllocator = context.getDirectChannelAccess().getChannel().alloc();<NEW_LINE>Publisher<ByteBuf> buffers = Streams.map(events, i -> ServerSentEventEncoder.INSTANCE.encode(i, byteBufAllocator));<NEW_LINE>EventLoop executor = context.getDirectChannelAccess().getChannel().eventLoop();<NEW_LINE>Clock clock = System::nanoTime;<NEW_LINE>if (bufferSettings != null) {<NEW_LINE>buffers = new ServerSentEventStreamBuffer(buffers, executor, byteBufAllocator, bufferSettings, clock);<NEW_LINE>}<NEW_LINE>if (heartbeatFrequency != null) {<NEW_LINE>buffers = new ServerSentEventStreamKeepAlive(buffers, executor, heartbeatFrequency, clock);<NEW_LINE>}<NEW_LINE>response.sendStream(buffers);<NEW_LINE>}
|
HttpHeaderConstants.TRANSFER_ENCODING, HttpHeaderConstants.CHUNKED);
|
194,005
|
public void handleCommand(ChannelUID channelUID, Command command) {<NEW_LINE>if (RefreshType.REFRESH.equals(command)) {<NEW_LINE>updateDeviceState(new DeviceChannelState(latestDeviceState));<NEW_LINE>updateTransitionState(new TransitionChannelState(latestTransitionState));<NEW_LINE>updateActionState(new ActionsChannelState(latestActionsState));<NEW_LINE>}<NEW_LINE>switch(channelUID.getId()) {<NEW_LINE>case PROGRAM_START_STOP:<NEW_LINE>if (PROGRAM_STARTED.matches(command.toString())) {<NEW_LINE>triggerProcessAction(START);<NEW_LINE>} else if (PROGRAM_STOPPED.matches(command.toString())) {<NEW_LINE>triggerProcessAction(STOP);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case PROGRAM_START_STOP_PAUSE:<NEW_LINE>if (PROGRAM_STARTED.matches(command.toString())) {<NEW_LINE>triggerProcessAction(START);<NEW_LINE>} else if (PROGRAM_STOPPED.matches(command.toString())) {<NEW_LINE>triggerProcessAction(STOP);<NEW_LINE>} else if (PROGRAM_PAUSED.matches(command.toString())) {<NEW_LINE>triggerProcessAction(PAUSE);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LIGHT_SWITCH:<NEW_LINE>if (command instanceof OnOffType) {<NEW_LINE>triggerLight(OnOffType.ON.equals(command));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case POWER_ON_OFF:<NEW_LINE>if (POWER_ON.matches(command.toString()) || POWER_OFF.matches(command.toString())) {<NEW_LINE>triggerPowerState(OnOffType.ON.equals(OnOffType.from(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
|
command.toString())));
|
918,010
|
private Mono<Response<RoleEligibilityScheduleRequestInner>> createWithResponseAsync(String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (scope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (roleEligibilityScheduleRequestName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.create(this.client.getEndpoint(), scope, roleEligibilityScheduleRequestName, apiVersion, parameters, accept, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter roleEligibilityScheduleRequestName is required and cannot be null."));
|
153,156
|
private void traverseView(View view, Map<Class<? extends Entity>, List<CrossDataStoreProperty>> crossPropertiesMap, Set<View> visited) {<NEW_LINE>if (visited.contains(view))<NEW_LINE>return;<NEW_LINE>visited.add(view);<NEW_LINE>String storeName = metadataTools.getStoreName(metaClass);<NEW_LINE>Class<? extends Entity> entityClass = view.getEntityClass();<NEW_LINE>for (ViewProperty viewProperty : view.getProperties()) {<NEW_LINE>MetaProperty metaProperty = metadata.getClassNN(entityClass).getPropertyNN(viewProperty.getName());<NEW_LINE>if (metaProperty.getRange().isClass()) {<NEW_LINE>MetaClass propertyMetaClass = metaProperty.getRange().asClass();<NEW_LINE>if (!Objects.equals(metadataTools.getStoreName(propertyMetaClass), storeName)) {<NEW_LINE>List<String> relatedProperties = metadataTools.getRelatedProperties(metaProperty);<NEW_LINE>if (relatedProperties.size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (relatedProperties.size() > 1) {<NEW_LINE>log.warn("More than 1 related property is defined for attribute {}, skip handling cross-datastore reference", metaProperty);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<CrossDataStoreProperty> crossProperties = crossPropertiesMap.computeIfAbsent(entityClass, k -> new ArrayList<>());<NEW_LINE>if (crossProperties.stream().noneMatch(aProp -> aProp.property == metaProperty))<NEW_LINE>crossProperties.add(<MASK><NEW_LINE>}<NEW_LINE>View propertyView = viewProperty.getView();<NEW_LINE>if (propertyView != null) {<NEW_LINE>traverseView(propertyView, crossPropertiesMap, visited);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
new CrossDataStoreProperty(metaProperty, viewProperty));
|
941,697
|
private void doRoll(Map<String, String> config) throws Exception {<NEW_LINE>long elapsed = System.currentTimeMillis() - lastRollCheck.get();<NEW_LINE>if (elapsed < (exhibitor.getConfigManager().getConfig().getInt(IntConfigs.BACKUP_MAX_STORE_MS) / 3)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>exhibitor.getLog().add(ActivityLog.Type.DEBUG, "Checking for elapsed backups");<NEW_LINE>List<BackupMetaData> availableBackups = backupProvider.get().getAvailableBackups(exhibitor, config);<NEW_LINE>for (BackupMetaData backup : availableBackups) {<NEW_LINE>long age = System.currentTimeMillis() - backup.getModifiedDate();<NEW_LINE>if (age > exhibitor.getConfigManager().getConfig().getInt(IntConfigs.BACKUP_MAX_STORE_MS)) {<NEW_LINE>exhibitor.getLog().add(ActivityLog.Type.DEBUG, "Cleaning backup: " + backup);<NEW_LINE>backupProvider.get().<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastRollCheck.set(System.currentTimeMillis());<NEW_LINE>}
|
deleteBackup(exhibitor, backup, config);
|
1,598,911
|
List<UserAgentShare> userAgentSearchShares(final StatsRequest statsRequest) {<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>logger.debug("Calculating user agent search shares");<NEW_LINE>String sql = "SELECT\n" + " user_agent,\n" + " count(*)\n" + "FROM SEARCH\n" + "WHERE user_agent IS NOT NULL\n" + "AND SOURCE = 'API'" + buildWhereFromStatsRequest(true, statsRequest) + "GROUP BY user_agent";<NEW_LINE>Query query = entityManager.createNativeQuery(sql);<NEW_LINE>List<Object> resultList = query.getResultList();<NEW_LINE>List<UserAgentShare> result = new ArrayList<>();<NEW_LINE>int countAll = 0;<NEW_LINE>for (Object o : resultList) {<NEW_LINE>Object[] o2 = (Object[]) o;<NEW_LINE>String userAgent <MASK><NEW_LINE>int countForUserAgent = ((BigInteger) o2[1]).intValue();<NEW_LINE>countAll += countForUserAgent;<NEW_LINE>result.add(new UserAgentShare(userAgent, countForUserAgent));<NEW_LINE>}<NEW_LINE>for (UserAgentShare userAgentShare : result) {<NEW_LINE>userAgentShare.setPercentage(100F / ((float) countAll / userAgentShare.getCount()));<NEW_LINE>}<NEW_LINE>result.sort(Comparator.comparingDouble(UserAgentShare::getPercentage).reversed());<NEW_LINE>logger.debug(LoggingMarkers.PERFORMANCE, "Calculated user agent search shares. Took {}ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));<NEW_LINE>return result;<NEW_LINE>}
|
= (String) o2[0];
|
364,295
|
public TypeBinding resolveType(BlockScope scope) {<NEW_LINE>if (this.actualReceiverType != null) {<NEW_LINE>this.binding = scope.getField(this.actualReceiverType, this.token, this);<NEW_LINE>if (this.binding != null && this.binding.isValidBinding()) {<NEW_LINE>throw new SelectionNodeFound(this.binding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// it can be a package, type, member type, local variable or field<NEW_LINE>this.binding = scope.getBinding(this.token, Binding.VARIABLE | Binding.TYPE | Binding.PACKAGE, this, true);<NEW_LINE>if (!this.binding.isValidBinding()) {<NEW_LINE>if (this.binding instanceof ProblemFieldBinding) {<NEW_LINE>// tolerate some error cases<NEW_LINE>if (this.binding.problemId() == ProblemReasons.NotVisible || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>scope.problemReporter().invalidField(this, (FieldBinding) this.binding);<NEW_LINE>} else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {<NEW_LINE>// tolerate some error cases<NEW_LINE>if (this.binding.problemId() == ProblemReasons.NotVisible) {<NEW_LINE>throw new SelectionNodeFound(this.binding);<NEW_LINE>}<NEW_LINE>scope.problemReporter().invalidType(this, (TypeBinding) this.binding);<NEW_LINE>} else {<NEW_LINE>scope.problemReporter().unresolvableReference(this, this.binding);<NEW_LINE>}<NEW_LINE>throw new SelectionNodeFound();<NEW_LINE>}<NEW_LINE>throw new SelectionNodeFound(this.binding);<NEW_LINE>}
|
throw new SelectionNodeFound(this.binding);
|
1,500,472
|
GeometryCursor intersectEx(Geometry input_geom) {<NEW_LINE>assert (m_dimensionMask != -1);<NEW_LINE>Geometry dst_geom = tryNativeImplementation_(input_geom);<NEW_LINE>if (dst_geom != null) {<NEW_LINE>Geometry[] res_vec = new Geometry[3];<NEW_LINE>res_vec[dst_geom.getDimension()] = dst_geom;<NEW_LINE>return prepareVector_(input_geom.<MASK><NEW_LINE>}<NEW_LINE>Envelope2D commonExtent = InternalUtils.getMergedExtent(m_geomIntersector, input_geom);<NEW_LINE>double t = InternalUtils.calculateToleranceFromGeometry(m_spatial_reference, commonExtent, true);<NEW_LINE>// Preprocess geometries to be clipped to the extent of intersection to<NEW_LINE>// get rid of extra segments.<NEW_LINE>Envelope2D env = new Envelope2D();<NEW_LINE>m_geomIntersector.queryEnvelope2D(env);<NEW_LINE>env.inflate(2 * t, 2 * t);<NEW_LINE>Envelope2D env1 = new Envelope2D();<NEW_LINE>input_geom.queryEnvelope2D(env1);<NEW_LINE>env.intersect(env1);<NEW_LINE>assert (!env.isEmpty());<NEW_LINE>env.inflate(100 * t, 100 * t);<NEW_LINE>double tol = 0;<NEW_LINE>Geometry clippedIntersector = Clipper.clip(m_geomIntersector, env, tol, 0.0);<NEW_LINE>Geometry clippedInputGeom = Clipper.clip(input_geom, env, tol, 0.0);<NEW_LINE>// perform the clip<NEW_LINE>Geometry[] res_vec;<NEW_LINE>res_vec = TopologicalOperations.intersectionEx(clippedInputGeom, clippedIntersector, m_spatial_reference, m_progress_tracker);<NEW_LINE>return prepareVector_(input_geom.getDescription(), m_dimensionMask, res_vec);<NEW_LINE>}
|
getDescription(), m_dimensionMask, res_vec);
|
471,331
|
private void checkImageNumQuota(String currentAccountUuid, String resourceTargetOwnerAccountUuid, Map<String, Quota.QuotaPair> pairs) {<NEW_LINE>long imageNumQuota = pairs.get(ImageQuotaConstant.IMAGE_NUM).getValue();<NEW_LINE>long imageNumUsed = new <MASK><NEW_LINE>long imageNumAsked = 1;<NEW_LINE>QuotaUtil.QuotaCompareInfo quotaCompareInfo;<NEW_LINE>{<NEW_LINE>quotaCompareInfo = new QuotaUtil.QuotaCompareInfo();<NEW_LINE>quotaCompareInfo.currentAccountUuid = currentAccountUuid;<NEW_LINE>quotaCompareInfo.resourceTargetOwnerAccountUuid = resourceTargetOwnerAccountUuid;<NEW_LINE>quotaCompareInfo.quotaName = ImageQuotaConstant.IMAGE_NUM;<NEW_LINE>quotaCompareInfo.quotaValue = imageNumQuota;<NEW_LINE>quotaCompareInfo.currentUsed = imageNumUsed;<NEW_LINE>quotaCompareInfo.request = imageNumAsked;<NEW_LINE>new QuotaUtil().CheckQuota(quotaCompareInfo);<NEW_LINE>}<NEW_LINE>}
|
ImageQuotaUtil().getUsedImageNum(resourceTargetOwnerAccountUuid);
|
1,184,225
|
public ListenableFuture<Pair<byte[], String>> wrapKeyAsync(final byte[] key, final String algorithm) throws NoSuchAlgorithmException {<NEW_LINE>if (key == null) {<NEW_LINE>throw new IllegalArgumentException("key");<NEW_LINE>}<NEW_LINE>// Interpret the requested algorithm<NEW_LINE>String algorithmName = (Strings.isNullOrWhiteSpace(algorithm<MASK><NEW_LINE>Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithmName);<NEW_LINE>if (baseAlgorithm == null || !(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) {<NEW_LINE>throw new NoSuchAlgorithmException(algorithmName);<NEW_LINE>}<NEW_LINE>AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm;<NEW_LINE>ICryptoTransform transform;<NEW_LINE>ListenableFuture<Pair<byte[], String>> result;<NEW_LINE>try {<NEW_LINE>transform = algo.CreateEncryptor(keyPair, provider);<NEW_LINE>result = Futures.immediateFuture(Pair.of(transform.doFinal(key), algorithmName));<NEW_LINE>} catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException e) {<NEW_LINE>result = Futures.immediateFailedFuture(e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
) ? getDefaultKeyWrapAlgorithm() : algorithm);
|
616,018
|
public Iterator<Map.Entry<String, String>> iterator() {<NEW_LINE>Iterator<Map.Entry<CharSequence, CharSequence>> i = headers.iterator();<NEW_LINE>return new Iterator<Map.Entry<String, String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return i.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map.Entry<String, String> next() {<NEW_LINE>Map.Entry<CharSequence, CharSequence> next = i.next();<NEW_LINE>return new Map.Entry<String, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getKey() {<NEW_LINE>return next.getKey().toString();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getValue() {<NEW_LINE>return next.getValue().toString();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String setValue(String value) {<NEW_LINE>String old = next<MASK><NEW_LINE>next.setValue(value);<NEW_LINE>return old;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return next.toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
|
.getValue().toString();
|
962,225
|
private void showRouteOnMap(List<WptPt> points) {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (points.size() > 0 && mapActivity != null) {<NEW_LINE>OsmandMapTileView mapView = mapActivity.getMapView();<NEW_LINE>double left = 0, right = 0;<NEW_LINE>double top = 0, bottom = 0;<NEW_LINE>Location myLocation = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();<NEW_LINE>if (mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) {<NEW_LINE>left = myLocation.getLongitude();<NEW_LINE>right = myLocation.getLongitude();<NEW_LINE>top = myLocation.getLatitude();<NEW_LINE>bottom = myLocation.getLatitude();<NEW_LINE>}<NEW_LINE>for (WptPt pt : points) {<NEW_LINE>if (left == 0) {<NEW_LINE>left = pt.getLongitude();<NEW_LINE>right = pt.getLongitude();<NEW_LINE>top = pt.getLatitude();<NEW_LINE>bottom = pt.getLatitude();<NEW_LINE>} else {<NEW_LINE>left = Math.min(left, pt.getLongitude());<NEW_LINE>right = Math.max(right, pt.getLongitude());<NEW_LINE>top = Math.max(top, pt.getLatitude());<NEW_LINE>bottom = Math.min(bottom, pt.getLatitude());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RotatedTileBox tb = mapView<MASK><NEW_LINE>int tileBoxWidthPx = 0;<NEW_LINE>int tileBoxHeightPx = 0;<NEW_LINE>if (portrait) {<NEW_LINE>tileBoxHeightPx = 3 * (tb.getPixHeight() - toolbarHeight) / 4;<NEW_LINE>} else {<NEW_LINE>tileBoxWidthPx = tb.getPixWidth() - mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);<NEW_LINE>}<NEW_LINE>mapView.fitRectToMap(left, right, top, bottom, tileBoxWidthPx, tileBoxHeightPx, toolbarHeight * 3 / 2);<NEW_LINE>}<NEW_LINE>}
|
.getCurrentRotatedTileBox().copy();
|
797,800
|
protected Object doWork() {<NEW_LINE>final Resource pythonScriptResource = new <MASK><NEW_LINE>List<String> arguments = new ArrayList<>(Arrays.asList("--reference_fasta", reference, "--input_vcf", inputVcf, "--bam_file", bamFile, "--train_vcf", truthVcf, "--bed_file", truthBed, "--tensor_name", tensorType.name(), "--annotation_set", annotationSet, "--samples", Integer.toString(maxTensors), "--downsample_snps", Float.toString(downsampleSnps), "--downsample_indels", Float.toString(downsampleIndels), "--data_dir", outputTensorsDir));<NEW_LINE>if (channelsLast) {<NEW_LINE>arguments.add("--channels_last");<NEW_LINE>} else {<NEW_LINE>arguments.add("--channels_first");<NEW_LINE>}<NEW_LINE>if (tensorType == TensorType.reference) {<NEW_LINE>arguments.addAll(Arrays.asList("--mode", "write_reference_and_annotation_tensors"));<NEW_LINE>} else if (tensorType == TensorType.read_tensor) {<NEW_LINE>arguments.addAll(Arrays.asList("--mode", "write_read_and_annotation_tensors"));<NEW_LINE>} else {<NEW_LINE>throw new GATKException("Unknown tensor mapping mode:" + tensorType.name());<NEW_LINE>}<NEW_LINE>logger.info("Args are:" + Arrays.toString(arguments.toArray()));<NEW_LINE>final boolean pythonReturnCode = pythonExecutor.executeScript(pythonScriptResource, null, arguments);<NEW_LINE>return pythonReturnCode;<NEW_LINE>}
|
Resource("training.py", CNNVariantWriteTensors.class);
|
579,689
|
private void bindView(View view) {<NEW_LINE>View llContent = view.findViewById(R.id.ll_content);<NEW_LINE>llContent.setOnClickListener(null);<NEW_LINE>searchView = view.findViewById(R.id.searchView);<NEW_LINE>atvTitle = view.findViewById(R.id.atv_title);<NEW_LINE>ibtStop = view.findViewById(R.id.ibt_stop);<NEW_LINE>rvSource = view.findViewById(R.id.rf_rv_change_source);<NEW_LINE>ibtStop.setVisibility(View.INVISIBLE);<NEW_LINE>rvSource.addItemDecoration(new DividerItemDecoration(context, LinearLayout.VERTICAL));<NEW_LINE>rvSource.setBaseRefreshListener(this::reSearchBook);<NEW_LINE>ibtStop.setOnClickListener(v -> stopChangeSource());<NEW_LINE>searchView.onActionViewExpanded();<NEW_LINE>searchView.clearFocus();<NEW_LINE>searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String query) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(String newText) {<NEW_LINE>if (StringUtils.isTrimEmpty(newText)) {<NEW_LINE>List<SearchBookBean> searchBookBeans = DbHelper.getDaoSession().getSearchBookBeanDao().queryBuilder().where(SearchBookBeanDao.Properties.Name.eq(bookName), SearchBookBeanDao.Properties.Author.eq(bookAuthor)).build().list();<NEW_LINE>adapter.reSetSourceAdapter();<NEW_LINE>adapter.addAllSourceAdapter(searchBookBeans);<NEW_LINE>} else {<NEW_LINE>List<SearchBookBean> searchBookBeans = DbHelper.getDaoSession().getSearchBookBeanDao().queryBuilder().where(SearchBookBeanDao.Properties.Name.eq(bookName), SearchBookBeanDao.Properties.Author.eq(bookAuthor), SearchBookBeanDao.Properties.Origin.like("%" + searchView.getQuery().toString() + "%"))<MASK><NEW_LINE>adapter.reSetSourceAdapter();<NEW_LINE>adapter.addAllSourceAdapter(searchBookBeans);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
.build().list();
|
132,080
|
public void showHomeFollowingArticles(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject user = (JSONObject) context.attr(User.USER);<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/following-articles.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = Symphonys.USER_HOME_LIST_CNT;<NEW_LINE>final int windowSize = Symphonys.USER_HOME_LIST_WIN_SIZE;<NEW_LINE>fillHomeUser(dataModel, user, roleQueryService);<NEW_LINE>final String followingId = user.optString(Keys.OBJECT_ID);<NEW_LINE>dataModel.<MASK><NEW_LINE>avatarQueryService.fillUserAvatarURL(user);<NEW_LINE>final JSONObject followingArticlesResult = followQueryService.getFollowingArticles(followingId, pageNum, pageSize);<NEW_LINE>final List<JSONObject> followingArticles = (List<JSONObject>) followingArticlesResult.opt(Keys.RESULTS);<NEW_LINE>dataModel.put(Common.USER_HOME_FOLLOWING_ARTICLES, followingArticles);<NEW_LINE>final boolean isLoggedIn = (Boolean) dataModel.get(Common.IS_LOGGED_IN);<NEW_LINE>if (isLoggedIn) {<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>final String followerId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final boolean isFollowing = followQueryService.isFollowing(followerId, followingId, Follow.FOLLOWING_TYPE_C_USER);<NEW_LINE>dataModel.put(Common.IS_FOLLOWING, isFollowing);<NEW_LINE>for (final JSONObject followingArticle : followingArticles) {<NEW_LINE>final String homeUserFollowingArticleId = followingArticle.optString(Keys.OBJECT_ID);<NEW_LINE>followingArticle.put(Common.IS_FOLLOWING, followQueryService.isFollowing(followerId, homeUserFollowingArticleId, Follow.FOLLOWING_TYPE_C_ARTICLE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int followingArticleCnt = followingArticlesResult.optInt(Pagination.PAGINATION_RECORD_COUNT);<NEW_LINE>final int pageCount = (int) Math.ceil(followingArticleCnt / (double) pageSize);<NEW_LINE>final List<Integer> pageNums = Paginator.paginate(pageNum, pageSize, pageCount, windowSize);<NEW_LINE>if (!pageNums.isEmpty()) {<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.get(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.get(pageNums.size() - 1));<NEW_LINE>}<NEW_LINE>dataModel.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);<NEW_LINE>dataModel.put(Pagination.PAGINATION_RECORD_COUNT, followingArticleCnt);<NEW_LINE>dataModel.put(Common.TYPE, "followingArticles");<NEW_LINE>}
|
put(Follow.FOLLOWING_ID, followingId);
|
1,343,683
|
public void validatePrototype(IndexPrototype prototype) {<NEW_LINE>IndexType indexType = prototype.getIndexType();<NEW_LINE>if (indexType != IndexType.LOOKUP) {<NEW_LINE>throw new IllegalArgumentException("The '" + getProviderDescriptor().name() + "' index provider does not support " + indexType + " indexes: " + prototype);<NEW_LINE>}<NEW_LINE>if (!prototype.schema().isAnyTokenSchemaDescriptor()) {<NEW_LINE>throw new IllegalArgumentException("The " + prototype.schema() + " index schema is not an any-token index schema, which it is required to be for the '" + getProviderDescriptor().name() + "' index provider to be able to create an index.");<NEW_LINE>}<NEW_LINE>if (!prototype.getIndexProvider().equals(DESCRIPTOR)) {<NEW_LINE>throw new IllegalArgumentException("The '" + getProviderDescriptor().name() + "' index provider does not support " + prototype.getIndexProvider() + " indexes: " + prototype);<NEW_LINE>}<NEW_LINE>if (prototype.isUnique()) {<NEW_LINE>throw new IllegalArgumentException("The '" + getProviderDescriptor().<MASK><NEW_LINE>}<NEW_LINE>}
|
name() + "' index provider does not support uniqueness indexes: " + prototype);
|
653,620
|
protected void doExecute(Task task, final MultiGetRequest request, final ActionListener<MultiGetResponse> listener) {<NEW_LINE>ClusterState clusterState = clusterService.state();<NEW_LINE>clusterState.blocks().globalBlockedRaiseException(ClusterBlockLevel.READ);<NEW_LINE>final AtomicArray<MultiGetItemResponse> responses = new AtomicArray<>(request.items.size());<NEW_LINE>final Map<ShardId, MultiGetShardRequest> shardRequests = new HashMap<>();<NEW_LINE>for (int i = 0; i < request.items.size(); i++) {<NEW_LINE>MultiGetRequest.Item item = request.items.get(i);<NEW_LINE>ShardId shardId;<NEW_LINE>try {<NEW_LINE>String concreteSingleIndex = indexNameExpressionResolver.concreteSingleIndex(clusterState, item).getName();<NEW_LINE>item.routing(clusterState.metadata().resolveIndexRouting(item.routing(), item.index()));<NEW_LINE>shardId = clusterService.operationRouting().getShards(clusterState, concreteSingleIndex, item.id(), item.routing(), null).shardId();<NEW_LINE>} catch (RoutingMissingException e) {<NEW_LINE>responses.set(i, newItemFailure(e.getIndex().getName(), e.getId(), e));<NEW_LINE>continue;<NEW_LINE>} catch (Exception e) {<NEW_LINE>responses.set(i, newItemFailure(item.index(), item.id(), e));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MultiGetShardRequest shardRequest = shardRequests.get(shardId);<NEW_LINE>if (shardRequest == null) {<NEW_LINE>shardRequest = new MultiGetShardRequest(request, shardId.getIndexName(), shardId.getId());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>shardRequest.add(i, item);<NEW_LINE>}<NEW_LINE>if (shardRequests.isEmpty()) {<NEW_LINE>// only failures..<NEW_LINE>listener.onResponse(new MultiGetResponse(responses.toArray(new MultiGetItemResponse[responses.length()])));<NEW_LINE>}<NEW_LINE>executeShardAction(listener, responses, shardRequests);<NEW_LINE>}
|
shardRequests.put(shardId, shardRequest);
|
33,343
|
public ThirdPartyFirewallMissingFirewallViolation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ThirdPartyFirewallMissingFirewallViolation thirdPartyFirewallMissingFirewallViolation = new ThirdPartyFirewallMissingFirewallViolation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ViolationTarget", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thirdPartyFirewallMissingFirewallViolation.setViolationTarget(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VPC", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thirdPartyFirewallMissingFirewallViolation.setVPC(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AvailabilityZone", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thirdPartyFirewallMissingFirewallViolation.setAvailabilityZone(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TargetViolationReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thirdPartyFirewallMissingFirewallViolation.setTargetViolationReason(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return thirdPartyFirewallMissingFirewallViolation;<NEW_LINE>}
|
class).unmarshall(context));
|
237,497
|
private void handle(CreateVipMsg msg) {<NEW_LINE>CreateVipReply reply = new CreateVipReply();<NEW_LINE>APICreateVipMsg amsg = new APICreateVipMsg();<NEW_LINE>amsg.setName(msg.getName());<NEW_LINE>amsg.setDescription(msg.getDescription());<NEW_LINE>amsg.setL3NetworkUuid(msg.getL3NetworkUuid());<NEW_LINE>amsg.setAllocatorStrategy(msg.getAllocatorStrategy());<NEW_LINE>amsg.setRequiredIp(msg.getRequiredIp());<NEW_LINE>amsg.setSystem(msg.isSystem());<NEW_LINE>amsg.setSession(msg.getSession());<NEW_LINE>if (msg.getRequiredIp() != null) {<NEW_LINE>if (NetworkUtils.isIpv4Address(msg.getRequiredIp())) {<NEW_LINE>amsg.setIpVersion(IPv6Constants.IPv4);<NEW_LINE>} else if (IPv6NetworkUtils.isIpv6Address(msg.getRequiredIp())) {<NEW_LINE>amsg.setIpVersion(IPv6Constants.IPv6);<NEW_LINE>}<NEW_LINE>} else if (msg.getIpVersion() != null) {<NEW_LINE>amsg.setIpVersion(msg.getIpVersion());<NEW_LINE>} else {<NEW_LINE>L3NetworkVO l3NetworkVO = dbf.findByUuid(msg.getL3NetworkUuid(), L3NetworkVO.class);<NEW_LINE>if (l3NetworkVO.getIpVersions().contains(IPv6Constants.IPv4)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>amsg.setIpVersion(IPv6Constants.IPv6);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>docreateVip(amsg, new ReturnValueCompletion<VipInventory>(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(VipInventory returnValue) {<NEW_LINE>reply.setVip(returnValue);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>reply.setError(errorCode);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
amsg.setIpVersion(IPv6Constants.IPv4);
|
99,117
|
private Map<String, AviatorFunction> load() {<NEW_LINE>InputStream in = null;<NEW_LINE>InputStreamReader inreader = null;<NEW_LINE>BufferedReader reader = null;<NEW_LINE>Map<String, AviatorFunction> ret = new HashMap<String, AviatorFunction>();<NEW_LINE>try {<NEW_LINE>in = ClassPathConfigFunctionLoader.class.<MASK><NEW_LINE>if (in != null) {<NEW_LINE>inreader = new InputStreamReader(in);<NEW_LINE>reader = new BufferedReader(inreader);<NEW_LINE>String line = null;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>line = line.trim();<NEW_LINE>if (line.startsWith("#")) {<NEW_LINE>// skip comment<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (line.length() > 0) {<NEW_LINE>AviatorFunction func = loadClass(line);<NEW_LINE>if (func != null) {<NEW_LINE>ret.put(func.getName(), func);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>error("Load aviator custom functions config from " + CUSTOM_FUNCTION_LIST_FILE + " failed.");<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>closeQuietly(reader);<NEW_LINE>closeQuietly(inreader);<NEW_LINE>closeQuietly(in);<NEW_LINE>if (totalCustomFunctions > 0) {<NEW_LINE>info("Total " + totalCustomFunctions + " custom functions loaded.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
|
getClassLoader().getResourceAsStream(CUSTOM_FUNCTION_LIST_FILE);
|
1,163,829
|
public void logBackendInit() {<NEW_LINE>String logInitProperty = System.getProperty(ND4JSystemProperties.LOG_INITIALIZATION, "true");<NEW_LINE>boolean logInit = Boolean.parseBoolean(logInitProperty);<NEW_LINE>if (logInit) {<NEW_LINE>try {<NEW_LINE>Nd4jCuda.Environment e = Nd4jCuda.Environment.getInstance();<NEW_LINE>int blasMajor = e.blasMajorVersion();<NEW_LINE>int blasMinor = e.blasMinorVersion();<NEW_LINE>int blasPatch = e.blasPatchVersion();<NEW_LINE>log.info("ND4J CUDA build version: {}.{}.{}", blasMajor, blasMinor, blasPatch);<NEW_LINE>int nGPUs = Nd4jEnvironment.getEnvironment().getNumGpus();<NEW_LINE>Properties props = Nd4j<MASK><NEW_LINE>List<Map<String, Object>> devicesList = (List<Map<String, Object>>) props.get(Nd4jEnvironment.CUDA_DEVICE_INFORMATION_KEY);<NEW_LINE>for (int i = 0; i < nGPUs; i++) {<NEW_LINE>Map<String, Object> dev = devicesList.get(i);<NEW_LINE>String name = (String) dev.get(Nd4jEnvironment.CUDA_DEVICE_NAME_KEY);<NEW_LINE>int major = ((Number) dev.get(Nd4jEnvironment.CUDA_DEVICE_MAJOR_VERSION_KEY)).intValue();<NEW_LINE>int minor = ((Number) dev.get(Nd4jEnvironment.CUDA_DEVICE_MINOR_VERSION_KEY)).intValue();<NEW_LINE>long totalMem = ((Number) dev.get(Nd4jEnvironment.CUDA_TOTAL_MEMORY_KEY)).longValue();<NEW_LINE>log.info("CUDA device {}: [{}]; cc: [{}.{}]; Total memory: [{}]", i, name, major, minor, totalMem);<NEW_LINE>}<NEW_LINE>log.info("Backend build information:\n {}", buildInfo());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.debug("Error logging CUDA backend versions and devices", t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.getExecutioner().getEnvironmentInformation();
|
115,154
|
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "nimble");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
false), new ListTagsForResourceResultJsonUnmarshaller());
|
799,273
|
private void processException(Thread thread, Throwable ex) {<NEW_LINE>Optional<File> optional = getDir();<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>Date date = new Date();<NEW_LINE>File file = new File(getDir().get(), "error-" + date.getTime() + "-" + BuildConfig.VERSION_CODE + ".log");<NEW_LINE>try {<NEW_LINE>@Cleanup<NEW_LINE><MASK><NEW_LINE>printWriter.println("System Information:");<NEW_LINE>printClass(printWriter, Build.VERSION.class);<NEW_LINE>printWriter.println();<NEW_LINE>printWriter.println();<NEW_LINE>printWriter.println("App Information:");<NEW_LINE>printClass(printWriter, BuildConfig.class);<NEW_LINE>printWriter.println();<NEW_LINE>printWriter.println();<NEW_LINE>printWriter.println("Crash Information");<NEW_LINE>printWriter.print("Timestamp: ");<NEW_LINE>printWriter.println(DateFormat.getDateTimeInstance(LONG, LONG, ENGLISH).format(date));<NEW_LINE>printWriter.print("Thread: ");<NEW_LINE>printWriter.println(thread.toString());<NEW_LINE>printWriter.println("Stacktrace:");<NEW_LINE>ex.printStackTrace(printWriter);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
PrintWriter printWriter = new PrintWriter(file);
|
1,511,578
|
public com.squareup.okhttp.Call apisApiIdDocumentsDocumentIdPutAsync(String apiId, String documentId, Document body, String contentType, String ifMatch, String ifUnmodifiedSince, final ApiCallback<Document> callback) throws ApiException {<NEW_LINE>ProgressResponseBody.ProgressListener progressListener = null;<NEW_LINE>ProgressRequestBody.ProgressRequestListener progressRequestListener = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progressListener = new ProgressResponseBody.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {<NEW_LINE>callback.onUploadProgress(bytesWritten, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>com.squareup.okhttp.Call call = apisApiIdDocumentsDocumentIdPutValidateBeforeCall(apiId, documentId, body, contentType, ifMatch, ifUnmodifiedSince, progressListener, progressRequestListener);<NEW_LINE>Type localVarReturnType = new TypeToken<Document>() {<NEW_LINE>}.getType();<NEW_LINE>apiClient.executeAsync(call, localVarReturnType, callback);<NEW_LINE>return call;<NEW_LINE>}
|
onDownloadProgress(bytesRead, contentLength, done);
|
870,813
|
private void writeFeatureChangeMessages(long startTime, ProvisioningMode provisioningMode) {<NEW_LINE>String time = TimestampUtils.getElapsedTimeNanos(startTime);<NEW_LINE>if (provisioningMode == ProvisioningMode.UPDATE) {<NEW_LINE>Tr.audit(tc, "COMPLETE_AUDIT", time);<NEW_LINE>} else {<NEW_LINE>if (tc.isInfoEnabled()) {<NEW_LINE>Tr.info(tc, "COMPLETE_AUDIT", time);<NEW_LINE>}<NEW_LINE>if (provisioningMode == ProvisioningMode.CONTENT_REQUEST) {<NEW_LINE>Tr.audit(tc, "SERVER_MINIFY", locationService.getServerName());<NEW_LINE>} else if (provisioningMode == ProvisioningMode.FEATURES_REQUEST) {<NEW_LINE>Tr.audit(tc, "SERVER_GATHER_FEATURES", locationService.getServerName());<NEW_LINE>} else {<NEW_LINE>if (supportedProcessTypes.contains(ProcessType.CLIENT)) {<NEW_LINE>Tr.audit(tc, <MASK><NEW_LINE>} else {<NEW_LINE>Tr.audit(tc, "SERVER_STARTED", locationService.getServerName(), TimestampUtils.getElapsedTime());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
"CLIENT_STARTED", locationService.getServerName());
|
1,820,735
|
public <Model> void inject(@NotNull Model model) {<NEW_LINE>try {<NEW_LINE>for (Class<?> type = model.getClass(); type != null && type != Object.class && type != Enum.class; type = type.getSuperclass()) {<NEW_LINE>MasterContext defaultContext = type.getAnnotation(MasterContext.class);<NEW_LINE>for (Field field : type.getDeclaredFields()) {<NEW_LINE>MasterContext fieldContext = field.getAnnotation(MasterContext.class);<NEW_LINE>String contextName = fieldContext != null ? fieldContext.value() : defaultContext != null ? defaultContext.value() : "local";<NEW_LINE>ConfigProperties configProperties2 = configProperties.addToScope(contextName);<NEW_LINE>String uri = configProperties2.get("uri");<NEW_LINE>DataStore dataStore = acquireDataStore(contextName, uri, contextName.equals(nodeName) ? ModelMode.MASTER : ModelMode.READ_ONLY);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>}
|
dataStore.injectField(model, field);
|
760,729
|
public static DescribeTemplateResponse unmarshall(DescribeTemplateResponse describeTemplateResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeTemplateResponse.setRequestId(_ctx.stringValue("DescribeTemplateResponse.RequestId"));<NEW_LINE>describeTemplateResponse.setId(_ctx.stringValue("DescribeTemplateResponse.Id"));<NEW_LINE>describeTemplateResponse.setName(_ctx.stringValue("DescribeTemplateResponse.Name"));<NEW_LINE>describeTemplateResponse.setDescription(_ctx.stringValue("DescribeTemplateResponse.Description"));<NEW_LINE>describeTemplateResponse.setType(_ctx.stringValue("DescribeTemplateResponse.Type"));<NEW_LINE>describeTemplateResponse.setRegion(_ctx.stringValue("DescribeTemplateResponse.Region"));<NEW_LINE>describeTemplateResponse.setOssBucket(_ctx.stringValue("DescribeTemplateResponse.OssBucket"));<NEW_LINE>describeTemplateResponse.setOssEndpoint(_ctx.stringValue("DescribeTemplateResponse.OssEndpoint"));<NEW_LINE>describeTemplateResponse.setOssFilePrefix(_ctx.stringValue("DescribeTemplateResponse.OssFilePrefix"));<NEW_LINE>describeTemplateResponse.setTrigger(_ctx.stringValue("DescribeTemplateResponse.Trigger"));<NEW_LINE>describeTemplateResponse.setStartTime(_ctx.stringValue("DescribeTemplateResponse.StartTime"));<NEW_LINE>describeTemplateResponse.setEndTime(_ctx.stringValue("DescribeTemplateResponse.EndTime"));<NEW_LINE>describeTemplateResponse.setInterval(_ctx.longValue("DescribeTemplateResponse.Interval"));<NEW_LINE>describeTemplateResponse.setRetention(_ctx.longValue("DescribeTemplateResponse.Retention"));<NEW_LINE>describeTemplateResponse.setFileFormat(_ctx.stringValue("DescribeTemplateResponse.FileFormat"));<NEW_LINE>describeTemplateResponse.setJpgOverwrite(_ctx.stringValue("DescribeTemplateResponse.JpgOverwrite"));<NEW_LINE>describeTemplateResponse.setJpgSequence(_ctx.stringValue("DescribeTemplateResponse.JpgSequence"));<NEW_LINE>describeTemplateResponse.setJpgOnDemand(_ctx.stringValue("DescribeTemplateResponse.JpgOnDemand"));<NEW_LINE>describeTemplateResponse.setMp4(_ctx.stringValue("DescribeTemplateResponse.Mp4"));<NEW_LINE>describeTemplateResponse.setFlv(_ctx.stringValue("DescribeTemplateResponse.Flv"));<NEW_LINE>describeTemplateResponse.setHlsM3u8(_ctx.stringValue("DescribeTemplateResponse.HlsM3u8"));<NEW_LINE>describeTemplateResponse.setHlsTs(_ctx.stringValue("DescribeTemplateResponse.HlsTs"));<NEW_LINE>describeTemplateResponse.setCallback(_ctx.stringValue("DescribeTemplateResponse.Callback"));<NEW_LINE>describeTemplateResponse.setCreatedTime(_ctx.stringValue("DescribeTemplateResponse.CreatedTime"));<NEW_LINE>List<TransConfig> transConfigs = new ArrayList<TransConfig>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeTemplateResponse.TransConfigs.Length"); i++) {<NEW_LINE>TransConfig transConfig = new TransConfig();<NEW_LINE>transConfig.setId(_ctx.stringValue("DescribeTemplateResponse.TransConfigs[" + i + "].Id"));<NEW_LINE>transConfig.setName(_ctx.stringValue("DescribeTemplateResponse.TransConfigs[" + i + "].Name"));<NEW_LINE>transConfig.setVideoCodec(_ctx.stringValue<MASK><NEW_LINE>transConfig.setVideoBitrate(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].VideoBitrate"));<NEW_LINE>transConfig.setFps(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Fps"));<NEW_LINE>transConfig.setGop(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Gop"));<NEW_LINE>transConfig.setHeight(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Height"));<NEW_LINE>transConfig.setWidth(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Width"));<NEW_LINE>transConfigs.add(transConfig);<NEW_LINE>}<NEW_LINE>describeTemplateResponse.setTransConfigs(transConfigs);<NEW_LINE>return describeTemplateResponse;<NEW_LINE>}
|
("DescribeTemplateResponse.TransConfigs[" + i + "].VideoCodec"));
|
1,114,399
|
public static void inventoryAttributes(Map<String, Inventory> attributes) {<NEW_LINE>String m = CardiovascularDiseaseModule.class.getSimpleName();<NEW_LINE>// Read<NEW_LINE>Attributes.inventory(attributes, m, Person.GENDER, true, false, "M");<NEW_LINE>Attributes.inventory(attributes, m, Person.GENDER, true, false, "F");<NEW_LINE>Attributes.inventory(attributes, m, Person.SMOKER, true, false, "true");<NEW_LINE>Attributes.inventory(attributes, m, Person.SMOKER, true, false, "false");<NEW_LINE>Attributes.inventory(attributes, m, "atrial_fibrillation", true, false, "false");<NEW_LINE>Attributes.inventory(attributes, m, "atrial_fibrillation_risk", true, false, null);<NEW_LINE>Attributes.inventory(attributes, m, "blood_pressure_controlled", true, false, "false");<NEW_LINE>Attributes.inventory(attributes, m, "cardio_risk", true, false, "-1.0");<NEW_LINE>Attributes.inventory(attributes, m, "coronary_heart_disease", true, false, "false");<NEW_LINE>Attributes.inventory(attributes, m, "cardiovascular_procedures", true, false, null);<NEW_LINE>Attributes.inventory(attributes, m, "cardiovascular_disease_med_changes", true, false, null);<NEW_LINE>Attributes.inventory(attributes, m, "diabetes", true, false, "false");<NEW_LINE>Attributes.inventory(attributes, m, "left_ventricular_hypertrophy", true, false, "false");<NEW_LINE>Attributes.inventory(attributes, m, <MASK><NEW_LINE>// Write<NEW_LINE>Attributes.inventory(attributes, m, "atrial_fibrillation", false, true, "true");<NEW_LINE>Attributes.inventory(attributes, m, "atrial_fibrillation_risk", false, true, "Numeric");<NEW_LINE>Attributes.inventory(attributes, m, "cardio_risk", false, true, "1.0");<NEW_LINE>Attributes.inventory(attributes, m, "cardiovascular_procedures", false, true, "Map<String, List<String>>");<NEW_LINE>Attributes.inventory(attributes, m, "cardiovascular_disease_med_changes", false, true, "Set<String>");<NEW_LINE>Attributes.inventory(attributes, m, "coronary_heart_disease", false, true, "true");<NEW_LINE>Attributes.inventory(attributes, m, "stroke_risk", false, true, "0.0");<NEW_LINE>Attributes.inventory(attributes, m, "stroke_risk", false, true, "0.5");<NEW_LINE>Attributes.inventory(attributes, m, "stroke_risk", false, true, "1.0");<NEW_LINE>Attributes.inventory(attributes, m, "stroke_points", false, true, "Numeric");<NEW_LINE>Attributes.inventory(attributes, m, "stroke_history", false, true, "true");<NEW_LINE>}
|
"stroke_risk", true, false, null);
|
1,788,579
|
public ListDeploymentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListDeploymentsResult listDeploymentsResult = new ListDeploymentsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listDeploymentsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("deployments", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDeploymentsResult.setDeployments(new ListUnmarshaller<Deployment>(DeploymentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDeploymentsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listDeploymentsResult;<NEW_LINE>}
|
class).unmarshall(context));
|
968,549
|
public void addCamera(Se3_F32 cameraToCommon, LensDistortionWideFOV factory, int width, int height) {<NEW_LINE>Point2Transform3_F32 p2s = factory.undistortPtoS_F32();<NEW_LINE>Point3Transform2_F32 s2p = factory.distortStoP_F32();<NEW_LINE>EquiToCamera equiToCamera = new EquiToCamera(cameraToCommon.getR(), s2p);<NEW_LINE>GrayF32 equiMask <MASK><NEW_LINE>PixelTransform<Point2D_F32> transformEquiToCam = new PixelTransformCached_F32(equiWidth, equHeight, new PointToPixelTransform_F32(equiToCamera));<NEW_LINE>Point3D_F32 p3b = new Point3D_F32();<NEW_LINE>Point2D_F32 p2 = new Point2D_F32();<NEW_LINE>for (int row = 0; row < equHeight; row++) {<NEW_LINE>for (int col = 0; col < equiWidth; col++) {<NEW_LINE>equiToCamera.compute(col, row, p2);<NEW_LINE>int camX = (int) (p2.x + 0.5f);<NEW_LINE>int camY = (int) (p2.y + 0.5f);<NEW_LINE>if (Double.isNaN(p2.x) || Double.isNaN(p2.y) || camX < 0 || camY < 0 || camX >= width || camY >= height)<NEW_LINE>continue;<NEW_LINE>p2s.compute(p2.x, p2.y, p3b);<NEW_LINE>if (Double.isNaN(p3b.x) || Double.isNaN(p3b.y) || Double.isNaN(p3b.z))<NEW_LINE>continue;<NEW_LINE>double angle = UtilVector3D_F32.acute(equiToCamera.unitCam, p3b);<NEW_LINE>if (angle < maskToleranceAngle) {<NEW_LINE>equiMask.set(col, row, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cameras.add(new Camera(equiMask, transformEquiToCam));<NEW_LINE>}
|
= new GrayF32(equiWidth, equHeight);
|
1,233,861
|
private IFhirResourceDao<? extends IBaseResource> toDao(UrlUtil.UrlParts theParts, String theVerb, String theUrl) {<NEW_LINE>RuntimeResourceDefinition resType;<NEW_LINE>try {<NEW_LINE>resType = myContext.<MASK><NEW_LINE>} catch (DataFormatException e) {<NEW_LINE>String msg = myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionInvalidUrl", theVerb, theUrl);<NEW_LINE>throw new InvalidRequestException(Msg.code(546) + msg);<NEW_LINE>}<NEW_LINE>IFhirResourceDao<? extends IBaseResource> dao = null;<NEW_LINE>if (resType != null) {<NEW_LINE>dao = myDaoRegistry.getResourceDao(resType.getImplementingClass());<NEW_LINE>}<NEW_LINE>if (dao == null) {<NEW_LINE>String msg = myContext.getLocalizer().getMessage(BaseStorageDao.class, "transactionInvalidUrl", theVerb, theUrl);<NEW_LINE>throw new InvalidRequestException(Msg.code(547) + msg);<NEW_LINE>}<NEW_LINE>return dao;<NEW_LINE>}
|
getResourceDefinition(theParts.getResourceType());
|
1,813,927
|
private Completable cleanMostPlayedPlaylist() {<NEW_LINE>if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>return Completable.complete();<NEW_LINE>}<NEW_LINE>return Completable.fromAction(() -> {<NEW_LINE>List<Integer> playCountIds = new ArrayList<>();<NEW_LINE>Query query = new Query.Builder().uri(PlayCountTable.URI).projection(new String[] { PlayCountTable.COLUMN_ID }).build();<NEW_LINE>SqlUtils.createActionableQuery(this, cursor -> playCountIds.add(cursor.getInt(cursor.getColumnIndex(PlayCountTable.COLUMN_ID))), query);<NEW_LINE>List<Integer> songIds = new ArrayList<>();<NEW_LINE>query = new Query.Builder().uri(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI).projection(new String[] { MediaStore.Audio.Media._ID }).build();<NEW_LINE>SqlUtils.createActionableQuery(this, cursor -> songIds.add(cursor.getInt(cursor.getColumnIndex(PlayCountTable.COLUMN_ID))), query);<NEW_LINE>StringBuilder selection = new StringBuilder(PlayCountTable.COLUMN_ID + " IN (");<NEW_LINE>selection.append(TextUtils.join(",", Stream.of(playCountIds).filter(playCountId -> !songIds.contains(playCountId<MASK><NEW_LINE>selection.append(")");<NEW_LINE>try {<NEW_LINE>getContentResolver().delete(PlayCountTable.URI, selection.toString(), null);<NEW_LINE>} catch (IllegalArgumentException ignored) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
)).toList()));
|
1,151,134
|
public static WorkerReportRequest buildWorkerReportRequest(Worker worker) {<NEW_LINE>WorkerReportRequest.Builder builder = WorkerReportRequest.newBuilder();<NEW_LINE>builder.setWorkerAttemptId(worker.getWorkerAttemptIdProto());<NEW_LINE>if (!worker.isWorkerInitFinished()) {<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>Map<TaskId, Task> tasks = worker<MASK><NEW_LINE>if (tasks != null && !tasks.isEmpty()) {<NEW_LINE>for (Entry<TaskId, Task> entry : tasks.entrySet()) {<NEW_LINE>builder.addTaskReports(buildTaskReport(entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pair.Builder kvBuilder = Pair.newBuilder();<NEW_LINE>Map<String, String> props = worker.getMetrics();<NEW_LINE>for (Entry<String, String> kv : props.entrySet()) {<NEW_LINE>kvBuilder.setKey(kv.getKey());<NEW_LINE>kvBuilder.setValue(kv.getValue());<NEW_LINE>builder.addPairs(kvBuilder.build());<NEW_LINE>}<NEW_LINE>// add the PSAgentContext,need fix<NEW_LINE>props = PSAgentContext.get().getMetrics();<NEW_LINE>for (Entry<String, String> kv : props.entrySet()) {<NEW_LINE>kvBuilder.setKey(kv.getKey());<NEW_LINE>kvBuilder.setValue(kv.getValue());<NEW_LINE>builder.addPairs(kvBuilder.build());<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
|
.getTaskManager().getRunningTask();
|
1,304,246
|
public void copy4x4(Matrix4x3d src, double[] dest, int off) {<NEW_LINE>dest[off + 0] = src.m00();<NEW_LINE>dest[off + 1] = src.m01();<NEW_LINE>dest[off + 2] = src.m02();<NEW_LINE>dest[off + 3] = 0.0;<NEW_LINE>dest[off + 4] = src.m10();<NEW_LINE>dest[off + <MASK><NEW_LINE>dest[off + 6] = src.m12();<NEW_LINE>dest[off + 7] = 0.0;<NEW_LINE>dest[off + 8] = src.m20();<NEW_LINE>dest[off + 9] = src.m21();<NEW_LINE>dest[off + 10] = src.m22();<NEW_LINE>dest[off + 11] = 0.0;<NEW_LINE>dest[off + 12] = src.m30();<NEW_LINE>dest[off + 13] = src.m31();<NEW_LINE>dest[off + 14] = src.m32();<NEW_LINE>dest[off + 15] = 1.0;<NEW_LINE>}
|
5] = src.m11();
|
1,190,127
|
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String resourceName, String agentPoolName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (agentPoolName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, resourceName, agentPoolName, accept, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.