Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package cisco
    Definition Classes
    com
  • package streambed

    The base package of the Streambed library.

    The base package of the Streambed library. Of note is the com.cisco.streambed.Application suite of types. These types conveniently establish a streambed environment for an application.

    Sample usage from Java:

    /**
     * Bootstraps our application and handles signals
     */
    public class MyServerEntryPoints {
        private static ApplicationProcess applicationProcess = null;
    
        public static void main(String[] args) {
            applicationProcess = new ApplicationProcess(new MyServer());
            applicationProcess.main(args);
        }
    
        public static void trap(int signal) {
          if (applicationProcess != null) {
                applicationProcess.trap(signal);
            }
        }
    }

    ...with MyServer being declared as:

    public class MyServer extends Application {
        @Override
        public void main(String[] args, ApplicationContext context) {
          ..
        }
    }

    The equivalent in Scala:

    object MyServerEntryPoints {
      private lazy val applicationProcess = ApplicationProcess(MyServer)
    
      def main(args: Array[String]): Unit =
        applicationProcess.main(args)
    
      def trap(signal: Int): Unit =
        applicationProcess.trap(signal)
    }

    ...with MyServer being declared as:

    object MyServer extends Application {
      override def main(args: Array[String], applicationContext: ApplicationContext): Unit = {
        ..
      }
    }

    The essential idea is that a regular JVM entry point (MyServerEntryPoints), establishes a com.cisco.streambed.ApplicationProcess of a class named MyServer. The trap method is used by Landlord for whenever an operating systemm signal is sent to the process. My extending com.cisco.streambed.Application, a com.cisco.streambed.ApplicationContext is provided by Streambed, containing almost all of what an application will require in order to startup (an actor system, metrics, logging...). The resources provided within the context are also automatically released on exit.

    Definition Classes
    cisco
  • package storage

    Storage provides mechanisms to persist and retrieve arbitrary data.

    Storage provides mechanisms to persist and retrieve arbitrary data. This complements com.cisco.streambed.durablequeue.DurableQueue and can be used a snapshotting mechanism, a common pattern in event sourcing and CQRS systems.

    By default, an implementation using the local filesystem is provided. E.g. see "com.cisco.streambed.storage.fs.FileSystemRawStorage" elsewhere.

    Definition Classes
    streambed
  • object Snapshots

    Types and functions for managing snapshots.

    Types and functions for managing snapshots. Snapshots dramatically speed up the sourcing of events. The actual load/save mechanism is an outside concern to the domain of this module. This module is focused on how events can flow from and to storage and become aggregated.

    A Snapshot's events are loaded and emitted as Snapshots.StoredEvent, followed by a Snapshots.StoredEventsDone on completion. New events are then sourced and emitted as Snapshots.StreamedEvents. A typical stream looks like:

    Snapshots
      .fromStorage(storageLoader)
      .flatMapConcat(
        initialState =>
          tailFromOffset(initialState.offset, finite)
            .scan((initialState, Option.empty[DashboardsEvents.Event])) {
              case ((state, _), (element, offset)) =>
                val newState = nextState(state, element, offset)
                (newState, Some(element))
            }
            .drop(1)
            .wireTap(Snapshots.toStorage(storageSaver))
            .collect(Snapshots.streamedEvent)
            .prepend(Snapshots.storedEvents(source(initialState), None)))
    Definition Classes
    storage
  • Aggregatable
  • SnapshotEvent
  • StoredEvent
  • StoredEventsDone
  • StreamedEvent

final case class StreamedEvent[A](element: A, offset: Option[Long]) extends SnapshotEvent[A] with Product with Serializable

A regular streamed event i.e. not loaded by storage.

A

The type of the elements to represent

Linear Supertypes
Serializable, Product, Equals, SnapshotEvent[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StreamedEvent
  2. Serializable
  3. Product
  4. Equals
  5. SnapshotEvent
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new StreamedEvent(element: A, offset: Option[Long])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. val element: A
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. val offset: Option[Long]
  15. def productElementNames: Iterator[String]
    Definition Classes
    Product
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from SnapshotEvent[A]

Inherited from AnyRef

Inherited from Any

Ungrouped