public class JdbcDataFetcher extends Object implements DataFetcher<String,String>
Constructor and Description |
---|
JdbcDataFetcher(MetadataStorageConnectorConfig connectorConfig,
String table,
String keyColumn,
String valueColumn,
Integer streamingFetchSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Iterable<Map.Entry<String,String>> |
fetch(Iterable<String> keys)
Function used to perform a bulk lookup
|
String |
fetch(String key)
Function to perform a one item lookup.
|
Iterable<Map.Entry<String,String>> |
fetchAll()
Function used to fetch all the pair of key-values from the lookup
One use case of this method is to populate a polling cache
PollingCache |
List<String> |
reverseFetchKeys(String value)
Function used to perform reverse lookup
|
public JdbcDataFetcher(MetadataStorageConnectorConfig connectorConfig, String table, String keyColumn, String valueColumn, Integer streamingFetchSize)
public Iterable<Map.Entry<String,String>> fetchAll()
DataFetcher
PollingCache
fetchAll
in interface DataFetcher<String,String>
Iterable
of key-value pairs.public String fetch(String key)
DataFetcher
fetch
in interface DataFetcher<String,String>
key
- non-null key used to lookup the valuepublic Iterable<Map.Entry<String,String>> fetch(Iterable<String> keys)
DataFetcher
fetch
in interface DataFetcher<String,String>
keys
- used to lookup the respective valuesIterable
containing the pair of existing key-value.public List<String> reverseFetchKeys(String value)
DataFetcher
reverseFetchKeys
in interface DataFetcher<String,String>
value
- use to fetch it's keys from the lookup tablevalue
or an empty list Collections.EmptyList
Copyright © 2011–2017. All rights reserved.