/*
 *  Copyright (c) 2012-2013 DataTorrent, Inc.
 *  All Rights Reserved.
 */
package com.datatorrent.stram.stream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.datatorrent.stram.engine.DefaultReservoir;
import com.datatorrent.stram.engine.Stream;
import com.datatorrent.stram.engine.StreamContext;
import com.datatorrent.stram.engine.SweepableReservoir;

/**
 *
 * @author Chetan Narsude <chetan@datatorrent.com>
 */
/**
 *
 * Inline streams are used for performance enhancement when both the operators are in the same hadoop container<p>
 * <br>
 * Inline is a hint that the stram can choose to ignore. Stram may also convert a normal stream into an inline one
 * for performance reasons. A stream tagged with persist flag will not be inlined, as persistence requires a buffer
 * server<br>
 * Inline streams currently cannot be partitioned. Since the main reason for partitioning
 * is to load balance and that means across different hadoop containers. In future we may take a look at it.<br>
 * <br>
 *
 * @since 0.3.2
 */
public class InlineStream extends DefaultReservoir implements Stream, SweepableReservoir
{
  public InlineStream(int capacity)
  {
    super("InlineStream", capacity);
  }

  /**
   *
   * @param context
   */
  @Override
  public void setup(StreamContext context)
  {
    setId(context.getId());
  }

  /**
   *
   * @param context
   */
  @Override
  public void activate(StreamContext context)
  {
  }

  /**
   *
   */
  @Override
  public void deactivate()
  {
    clear();
  }

  /**
   *
   */
  @Override
  public void teardown()
  {
    clear();
  }

  @Override
  public void put(Object tuple)
  {
    try {
      super.put(tuple);
    }
    catch (InterruptedException ie) {
      logger.debug("Interrupted", ie);
      throw new RuntimeException(ie);
    }
  }

  @Override
  public String toString()
  {
    return "InlineStream{" + super.toString() + '}';
  }

  private static final Logger logger = LoggerFactory.getLogger(InlineStream.class);
}

@@ -388,135 +388,46 @@
 %0A * 
-@author Chetan Narsude %3Cchetan@datatorrent.com%3E%0A */%0A/**%0A *%0A * Inline streams are used for performance enhancement when both the
+When data exchange is needed between 2
  ope
@@ -437,11 +437,16 @@
 ors 
-are
+deployed
  in 
@@ -454,23 +454,16 @@
 he same 
-hadoop 
 containe
@@ -467,478 +467,176 @@
 iner
-%3Cp%3E%0A * %3Cbr%3E%0A * Inline is a hint that the stram can choose to ignore. Stram may also convert a normal stream into an inline one%0A * for performance reasons. A stream tagged with persist flag will not be inlined, as persistence requires a buffer%0A * server%3Cbr%3E%0A *
+, they are connected using a%0A * blocking queue; The implementation of such a blocking queue is
  Inline
- s
+S
 tream
-s currently cannot be partitioned. Since the main reason for partitioning%0A * is to load balance and that means across different hadoop containers. In future we may take a look at it.%3Cbr%3E%0A * %3Cbr%3E%0A *
+.%3Cbr /%3E%0A *%0A * @author Chetan Narsude %3Cchetan@datatorrent.com%3E
 %0A * 

remove incorrect comments.