beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jingsong Lee (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-42) State for "Map" data, supporting efficient key lookup, etc.
Date Wed, 08 Feb 2017 04:02:41 GMT

    [ https://issues.apache.org/jira/browse/BEAM-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15857350#comment-15857350
] 

Jingsong Lee commented on BEAM-42:
----------------------------------

MapState maybe need more "sighted write"(contrary to "blind write"). There are also interfaces
to be discussed.
{code:title=Bar.java|borderStyle=solid}
/**
 * An object that maps keys to values.
 * A map cannot contain duplicate keys;
 * each key can map to at most one value.
 *
 * @param <K> the type of keys maintained by this map
 * @param <V> the type of mapped values
 */
public interface MapState<K, V> extends ReadableState<Iterator<Map.Entry<K,
V>>>, State {

  V get(K key);

  void put(K key, V value);

  V putIfAbsent(K key, V value);

  void remove(K key);

  Iterable<K> keys();

  Iterable<V> values();

  @Override
  MapState<K, V> readLater();
}
{code}


> State for "Map" data, supporting efficient key lookup, etc.
> -----------------------------------------------------------
>
>                 Key: BEAM-42
>                 URL: https://issues.apache.org/jira/browse/BEAM-42
>             Project: Beam
>          Issue Type: New Feature
>          Components: beam-model
>            Reporter: Kenneth Knowles
>            Assignee: Kenneth Knowles
>            Priority: Minor
>              Labels: State
>
> Analogous to BagState's blind writes, and SetState's efficient membership check, MapState
would add efficient key lookup and mutation, and other Map-related operations.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message