summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorgjoranv <gv@oath.com>2018-09-17 15:35:00 +0200
committergjoranv <gv@oath.com>2018-09-18 11:29:44 +0200
commit96d60a40e2c451ea4021fdec6be526a40fa48176 (patch)
tree9f3951758832fc87748f9fdd0178a9405f13312c /vespajlib
parent59f42ff1e807e60361d13663e4039038cd239120 (diff)
Remove unused and deprecated classes in non-public package.
- ConcurrentResourcePool, ResourceFactory, ResourcePool
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java36
-rw-r--r--vespajlib/src/main/java/com/yahoo/collections/ResourceFactory.java13
-rw-r--r--vespajlib/src/main/java/com/yahoo/collections/ResourcePool.java38
3 files changed, 0 insertions, 87 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java b/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java
deleted file mode 100644
index b49e0c8bbbc..00000000000
--- a/vespajlib/src/main/java/com/yahoo/collections/ConcurrentResourcePool.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.collections;
-
-import java.util.Iterator;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-/**
- * @author baldersheim
- * TODO: remove on vespa 7 or before
- * Use com.yahoo.yolean.concurrent.ConcurrentResourcePool instead.
- */
-@Deprecated
-public class ConcurrentResourcePool<T> implements Iterable<T> {
-
- private final Queue<T> pool = new ConcurrentLinkedQueue<>();
- private final ResourceFactory<T> factory;
-
- public ConcurrentResourcePool(ResourceFactory<T> factory) {
- this.factory = factory;
- }
-
- public final T alloc() {
- final T e = pool.poll();
- return e != null ? e : factory.create();
- }
-
- public final void free(T e) {
- pool.offer(e);
- }
-
- @Override
- public Iterator<T> iterator() {
- return pool.iterator();
- }
-}
diff --git a/vespajlib/src/main/java/com/yahoo/collections/ResourceFactory.java b/vespajlib/src/main/java/com/yahoo/collections/ResourceFactory.java
deleted file mode 100644
index 7a8e7dafbc4..00000000000
--- a/vespajlib/src/main/java/com/yahoo/collections/ResourceFactory.java
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.collections;
-
-/**
- * @author baldersheim
- * TODO: remove on vespa 7 or before
- * Use com.yahoo.yolean.concurrent.ResourceFactory instead.
- */
-@Deprecated
-public abstract class ResourceFactory<T> {
-
- public abstract T create();
-}
diff --git a/vespajlib/src/main/java/com/yahoo/collections/ResourcePool.java b/vespajlib/src/main/java/com/yahoo/collections/ResourcePool.java
deleted file mode 100644
index a6ad8b96a04..00000000000
--- a/vespajlib/src/main/java/com/yahoo/collections/ResourcePool.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.collections;
-
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.Iterator;
-
-/**
- * <p>This implements a simple stack based resource pool. If you are out of resources new are allocated from the
- * factory.</p>
- *
- * @author baldersheim
- * TODO: remove on vespa 7 or before
- * Use com.yahoo.yolean.concurrent.ResourceFactory instead.
- */
-@Deprecated
-public final class ResourcePool<T> implements Iterable<T> {
-
- private final Deque<T> pool = new ArrayDeque<>();
- private final ResourceFactory<T> factory;
-
- public ResourcePool(ResourceFactory<T> factory) {
- this.factory = factory;
- }
-
- public final T alloc() {
- return pool.isEmpty() ? factory.create() : pool.pop();
- }
-
- public final void free(T e) {
- pool.push(e);
- }
-
- @Override
- public Iterator<T> iterator() {
- return pool.iterator();
- }
-}