Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gplazma: grid add interface to abstract SourceBackedPredicateMap
Motivation: The SourceBackedPredicateMap provides a concrete implementation of access to (key-predicate,value) pairs. However, to support new approaches, it would be useful to allow alternative implementations of this behaviour. Modification: Add an interface to abstract away concrete implementation. Result: No user- or admin observable changes. Code is more flexible, in preparation for future changes. Target: master Requires-notes: no Requires-book: no Patch: https://rb.dcache.org/r/13663/ Acked-by: Tigran Mkrtchyan
- Loading branch information
1 parent
9c91096
commit c5de48f
Showing
8 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
modules/gplazma2-grid/src/main/java/org/dcache/gplazma/plugins/PredicateMap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* dCache - http://www.dcache.org/ | ||
* | ||
* Copyright (C) 2022 Deutsches Elektronen-Synchrotron | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.dcache.gplazma.plugins; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Handle a list of items where each item is a key-predicate,value pair. Each | ||
* key-predicate may be matched against some key. | ||
* @param <K> The type of the keys. | ||
* @param <V> The type of the values. | ||
*/ | ||
public interface PredicateMap<K, V> { | ||
|
||
/** | ||
* Provide a list of items that match the supplied key. | ||
* @param key the key to search for matching items. | ||
* @return A list of values that match the supplied key. | ||
*/ | ||
List<V> getValuesForPredicatesMatching(K key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters