apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilooner <...@git.apache.org>
Subject [GitHub] apex-malhar pull request #345: REVIEW ONLY (WindowedOperator): splitting Win...
Date Mon, 18 Jul 2016 02:10:30 GMT
Github user ilooner commented on a diff in the pull request:

    https://github.com/apache/apex-malhar/pull/345#discussion_r71095303
  
    --- Diff: library/src/main/java/org/apache/apex/malhar/lib/window/impl/SpillableWindowedKeyedStorage.java
---
    @@ -0,0 +1,136 @@
    +package org.apache.apex.malhar.lib.window.impl;
    +
    +import java.util.List;
    +import java.util.Map;
    +
    +import javax.annotation.concurrent.Immutable;
    +import javax.validation.constraints.NotNull;
    +
    +import org.apache.apex.malhar.lib.state.spillable.SpillableByteArrayListMultimapImpl;
    +import org.apache.apex.malhar.lib.state.spillable.SpillableByteMapImpl;
    +import org.apache.apex.malhar.lib.state.spillable.managed.ManagedStateSpillableStateStore;
    +import org.apache.apex.malhar.lib.utils.serde.Serde;
    +import org.apache.apex.malhar.lib.window.Window;
    +import org.apache.apex.malhar.lib.window.WindowedStorage;
    +import org.apache.commons.lang3.tuple.ImmutablePair;
    +
    +import com.datatorrent.netlet.util.Slice;
    +
    +/**
    + * Created by david on 7/15/16.
    + */
    +public class SpillableWindowedKeyedStorage<K, V> implements WindowedStorage.WindowedKeyedStorage<K,
V>
    +{
    +  @NotNull
    +  private final ManagedStateSpillableStateStore store;
    +
    +  protected final SpillableByteMapImpl<ImmutablePair<Window, K>, V> internValues;
    +  protected final SpillableByteArrayListMultimapImpl<Window, K> internKeys;
    +
    +  private SpillableWindowedKeyedStorage()
    +  {
    +    // for kryo
    +    store = null;
    +    internValues = null;
    +    internKeys = null;
    +  }
    +
    +  public SpillableWindowedKeyedStorage(long bucket, byte[] identifier, Serde<Window,
Slice> serdeWindow, Serde<K, Slice> serdeKey, Serde<ImmutablePair<Window, K>,
Slice> serdeWindowKey, Serde<V, Slice> serdeValue)
    +  {
    +    store = new ManagedStateSpillableStateStore();
    +    store.getCheckpointManager().setNeedBucketFile(false);
    +    internValues = new SpillableByteMapImpl<>(store, identifier, bucket, serdeWindowKey,
serdeValue);
    --- End diff --
    
    Spillable data structures should be created in setup()


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message