Code Examples
A repository of 155 code examples for BeepBeep
complex.FileDemo Class Reference

Creates complex events out of low-level events occurring to files. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Creates complex events out of low-level events occurring to files.

Each basic event represents an operation done on a Java iterator. It is an array made of at least two elements:

  • The name of the file being manipulated (a String)
  • The name of the operation being done on this file (a String)

The operation can be either "open", "close", "read" or "write". When the operation is "write" or "read", the array contains two more elements:

  • The offset at which bytes are written (resp. read)
  • The number of bytes being written (resp. read)

The goal is to produce a high-level stream where each event summarizes the "lifecycle" of a file. When a file is closed, a "complex" FileOperation event should be produced, summarizing the operations done on this file during the time it was open:

  • The filename
  • Whether the interaction was for reading or for writing
  • The number of bytes read (or written)
  • Whether the operations were contiguous. Contiguous operations mean that the first read (resp. write) operation occurs at the start of the file (offset 0), and that the next operation starts where the previous one left off.
  • The global range of bytes that was accessed by this interaction. This is calculated as the interval from the minimum value of offset seen in an operation, to the maximum value of offset+length.

The pipeline allows resets, which means that if the same file is reopened at a later time, a new complex event will eventually be output for this new interaction.

The global pipeline is illustrated as follows:

<img src={}/doc-files/complex/FileAccess.png" alt="Pipeline" />

Definition at line 87 of file FileDemo.java.


The documentation for this class was generated from the following file: