API-Eulerian

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

    you changed the files and the date of any change; and

    b) cause the whole of any work that you distribute or publish, that
    in whole or in part contains the Program or any part thereof, either
    with or without modifications, to be licensed at no charge to all
    third parties under the terms of this General Public License (except
    that you may choose to grant warranty protection to some or all
    third parties, at your option).

    c) If the modified program normally reads commands interactively when
    run, you must cause it, when started running for such interactive use
    in the simplest and most usual way, to print or display an
    announcement including an appropriate copyright notice and a notice
    that there is no warranty (or else, saying that you provide a
    warranty) and that users may redistribute the program under these
    conditions, and telling the user how to view a copy of this General
    Public License.

    d) You may charge a fee for the physical act of transferring a
    copy, and you may at your option offer warranty protection in
    exchange for a fee.

LICENSE  view on Meta::CPAN

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or (at your option)
    any later version.

LICENSE  view on Meta::CPAN

    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19xx name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your

lib/API/Eulerian/EDW/Bench.pm  view on Meta::CPAN

    _SUITE => {},
    _LAST => undef,
    _FIRST => undef,
  }, shift );
}
#
# @brief Start chronograph.
#
# @param $self - API::Eulerian::EDW::Bench instance.
#
sub start
{
  shift->last( new API::Eulerian::EDW::Chrono() );
}
#
# @brief Get/Set First Stage.
#
# @param $self - API::Eulerian::EDW::Bench instance.
# @param $first - First stage.
#
# @return First stage.

lib/API/Eulerian/EDW/Bench.pm  view on Meta::CPAN

I<Allocate and initialize a new API::Eulerian::EDW::Bench instance>

=head3 output

=over 4

=item * API::Eulerian::EDW::Bench instance.

=back

=head2 start()

I<Start chronograph on current bench stage>

=head3 input

=over 4

=item * API::Eulerian::EDW::Bench instance.

=back

lib/API/Eulerian/EDW/Hook.pm  view on Meta::CPAN

#
sub setup
{
  my ( $self, $setup ) = @_;
}
#
# @brief
#
# @param $self - Eulerian Data Warehouse Peer Hook.
# @param $uuid - UUID of Eulerian Analytics Analysis.
# @param $start - Timerange begin.
# @param $end - Timerange end.
# @param $columns - Array of Columns definitions.
#
sub on_headers
{
  my ( $self, $uuid, $start, $end, $columns ) = @_;
}
#
# @brief
#
# @param $self - Eulerian Data Warehouse Peer Hook.
# @param $uuid - UUID of Eulerian Analytics Analysis.
# @param $rows - Array of Array of Columns values.
#
sub on_add
{

lib/API/Eulerian/EDW/Hook.pm  view on Meta::CPAN


I<Interface definition of the callback function used whenever a new Eulerian
Data Warehouse Started.>

=head3 input

=over 4

=item * uuid - Eulerian Data Warehouse Analysis identifier.

=item * start - UNIX Timestamp of the beginning of Eulerian Data Warehouse Analysis.

=item * end - UNIX Timestamp of the end of Eulerian Data Warehouse Analysis.

=item * headers - Perl Array of Columns headers.

=back

=head2 on_add()

I<Interface definition of the callback function used to proceed an Eulerian Data

lib/API/Eulerian/EDW/Hook/Noop.pm  view on Meta::CPAN

sub setup
{
  my ( $self, $setup ) = @_;
  return $self;
}
#
# @brief Start a new Analysis.
#
# @param $self - Eulerian Data Warehouse Peer Hook.
# @param $uuid - UUID of Eulerian Analytics Analysis.
# @param $start - Timerange begin.
# @param $end - Timerange end.
# @param $columns - Array of Columns definitions.
#
sub on_headers
{
  my ( $self, $uuid, $start, $end, $columns ) = @_;
  return $self;
}
#
# @brief Analysis reply rows on Row outputs analysis.
#
# @param $self - Eulerian Data Warehouse Peer Hook.
# @param $uuid - UUID of Eulerian Analytics Analysis.
# @param $rows - Array of Array of Columns values.
#
sub on_add

lib/API/Eulerian/EDW/Hook/Print.pm  view on Meta::CPAN

sub setup
{
  my ( $self, $setup ) = @_;
  return $self;
}
#
# @brief Start a new Analysis.
#
# @param $self - Eulerian Data Warehouse Peer Hook.
# @param $uuid - UUID of Eulerian Analytics Analysis.
# @param $start - Timerange begin.
# @param $end - Timerange end.
# @param $columns - Array of Columns definitions.
#
sub on_headers
{
  my ( $self, $uuid, $start, $end, $columns ) = @_;
  my $string = <<string_end;
  {
    . UUID      : $uuid
    . TIMERANGE : {
        begin : $start,
        end : $end,
      },
    . HEADERS   : {
string_end
  foreach my $column ( @$columns ) {
    if( ref( $column ) eq 'ARRAY' ) {
      $string .= "        $column->[ 0 ] : $column->[ 1 ],\n";
    } else {
      # Thin Peer doesnt return columns types
      $string .= "               UNKNOWN : $column,\n";

lib/API/Eulerian/EDW/Parser/CSV.pm  view on Meta::CPAN

#
# @param $self - API::Eulerian::EDW::Parser
#
sub do
{
  my ( $self, $hooks ) = @_;
  my $parser = $self->parser();
  my $file = $self->file();
  my $uuid = $self->uuid();
  my @headers = ();
  my $start = 0;
  my $end = 0;
  my @rows;
  my $line;

  # in case of Noop - do not do any treatment on returned data - exit
  if ( $hooks eq 'API::Eulerian::EDW::Hook::Noop' ) {
    return;
  }

  # Process Headers line
  $line = <$file>; chomp $line;
  if( $parser->parse( $line ) ) {
    foreach my $field ( $parser->fields() ) {
      push @headers, [ 'UNKNOWN', $field ];
    }
    $hooks->on_headers( $uuid, $start, $end, \@headers );
  }

  # Process Next lines
  while( my $line = <$file> ) {
    chomp $line;
    if( $parser->parse( $line ) ) {
      @rows = [ $parser->fields() ];
      $hooks->on_add( $uuid, \@rows );
    }
  }

lib/API/Eulerian/EDW/Parser/JSON.pm  view on Meta::CPAN

  my $parser = $self->parser();
  my $depth = -1;
  my @in = ();
  my $uuid;
  my $msg;
  my $key;

  # Parse JSON stream
  $parser->process_tokens(
    # Property begin
    start_property => sub
    {
      $key = shift;
    },
    # Property end
    end_property => sub
    {
    },
    # String
    add_string => sub
    {

lib/API/Eulerian/EDW/Parser/JSON.pm  view on Meta::CPAN

    add_null => sub
    {
      my $parent = $in[ $depth ];
      if( ref( $parent ) eq 'ARRAY' ) {
        $parent->[ scalar( @$parent ) ] = undef;
      } elsif( ref( $parent ) eq 'HASH' ) {
        $parent->{ $key } = undef;
      }
    },
    # Object begin
    start_object => sub
    {
      $in[ ++$depth ] = {};
    },
    # Object end
    end_object => sub
    {
      my $parent = $in[ $depth - 1 ] if $depth > 0;
      if( ref( $parent ) eq 'ARRAY' ) {
        $parent->[ scalar( @$parent ) ] = $in[ $depth ];
      } elsif( ref( $parent ) eq 'HASH' ) {

lib/API/Eulerian/EDW/Parser/JSON.pm  view on Meta::CPAN

        $uuid = $msg->{ uuid };
        print( "UUID : $uuid\n" );
        $hooks->on_headers(
          $uuid, $msg->{ from }, $msg->{ to },
          $msg->{ schema }
          );
      }
      $depth--;
    },
    # Array begin
    start_array => sub
    {
      $in[ ++$depth ] = [];
    },
    # Array end
    end_array => sub
    {
      my $parent = $in[ $depth - 1 ] if $depth > 0;
      if( ref( $parent ) eq 'ARRAY' ) {
        $parent->[ scalar( @$parent ) ] = $in[ $depth ];
      } elsif( ref( $parent ) eq 'HASH' ) {

lib/API/Eulerian/EDW/Peer/Rest.pm  view on Meta::CPAN

use Data::Dumper;
sub request
{
  my ( $self, $command ) = @_;
  my $bench = new API::Eulerian::EDW::Bench();
  my $response;
  my $status;
  my $json;

  # Create Job on Eulerian Data Warehouse Platform
  $bench->start();
  $status = $self->create( $command );
  $bench->stage( 'create' );

  # Wait end of Job
  $bench->start();
  while( ! $status->error() && $self->running( $status ) ) {
    $status = $self->status( $status );
    sleep( 2 );
  }
  $bench->stage( 'running' );

  # If Done, download reply file
  if( ! $status->error() && $self->done( $status ) ) {
    $bench->start();
    $status = $self->download( $status );
    $bench->stage( 'download' );
    if( ! $status->error() ) {
      # Parse reply file, call hooks
      $bench->start();
      $status = $self->parse( $status );
      $bench->stage( 'parse' );
    }
    $status->{ bench } = $bench;
  } else {
    print "ERROR : " . Dumper( $status ) . "\n";
  }

  return $status;
}

lib/API/Eulerian/EDW/Peer/Thin.pm  view on Meta::CPAN

#
sub request
{
  my ( $self, $command ) = @_;
  my $bench = new API::Eulerian::EDW::Bench();
  my $response;
  my $status;
  my $json;

  # Create Job on Eulerian Data Warehouse Platform
  $bench->start();
  $status = $self->create( $command );
  $bench->stage( 'create' );

  if( ! $status->error() ) {
    # Join Websocket call user specific callback hook
    $bench->start();
    $status = $self->join( $status );
    $bench->stage( 'join' );
    $status->{ bench } = $bench;
  }

  return $status;
}
#
# @brief Cancel Job on Eulerian Data Warehouse Platform.
#



( run in 0.303 second using v1.01-cache-2.11-cpan-0d8aa00de5b )