summaryrefslogtreecommitdiff
path: root/src/main/java/com/android/vts/util/TaskQueueHelper.java
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2022-05-16 22:42:17 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-05-16 22:42:17 +0000
commit7d1a227ff79e5cc0f88eed99ef516c5aec9cce5c (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/main/java/com/android/vts/util/TaskQueueHelper.java
parenta9bd47e4caa21d535fb89c0e6efe23fa08d25847 (diff)
parent5b68078669f69925457f616994578babeabafc50 (diff)
downloaddashboard-android12L-tests-dev.tar.gz
remove code for vti dashboard am: 4ebfbc3e96 am: 4642c7edfa am: 5b68078669android12L-tests-dev
Original change: https://android-review.googlesource.com/c/platform/test/vti/dashboard/+/1926182 Change-Id: Ie701e4405fef964a477b198389ccfdd622fade10 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src/main/java/com/android/vts/util/TaskQueueHelper.java')
-rw-r--r--src/main/java/com/android/vts/util/TaskQueueHelper.java50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/main/java/com/android/vts/util/TaskQueueHelper.java b/src/main/java/com/android/vts/util/TaskQueueHelper.java
deleted file mode 100644
index 3d5df53..0000000
--- a/src/main/java/com/android/vts/util/TaskQueueHelper.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright 2017 Google Inc. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.vts.util;
-
-import com.google.appengine.api.taskqueue.Queue;
-import com.google.appengine.api.taskqueue.TaskOptions;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/** TaskQueueHelper, a helper class for interacting with App Engine Task Queue API. */
-public class TaskQueueHelper {
- protected static final Logger logger = Logger.getLogger(TaskQueueHelper.class.getName());
- public static final int MAX_BATCH_ADD_SIZE = 100;
-
- /**
- * Add the list of tasks to the provided queue.
- *
- * @param queue The task queue in which to insert the tasks.
- * @param tasks The list of tasks to add.
- */
- public static void addToQueue(Queue queue, List<TaskOptions> tasks) {
- List<TaskOptions> puts = new ArrayList<>();
- for (TaskOptions task : tasks) {
- puts.add(task);
- if (puts.size() == MAX_BATCH_ADD_SIZE) {
- queue.addAsync(puts);
- puts = new ArrayList<>();
- } else if (puts.size() > MAX_BATCH_ADD_SIZE) {
- logger.log(Level.SEVERE, "Too many tasks batched in the task queue API.");
- return;
- }
- }
- if (puts.size() > 0) {
- queue.addAsync(puts);
- }
- }
-}