David Golden > Metabase-1.001 > Metabase::Archive

Download:
Metabase-1.001.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  7
Open  0
View/Report Bugs
Module Version: 1.001   Source   Latest Release: Metabase-1.003

NAME ^

Metabase::Archive - Interface for Metabase storage

VERSION ^

version 1.001

SYNOPSIS ^

  package Metabase::Archive::Foo;
  use Metabase::Fact;
  use Moose;
  with 'Metabase::Archive';
  
  # define Moose attributes
  
  sub store {
    my ( $self, $fact_struct ) = @_;
    # store a fact
  }

  sub extract {
    my ( $self, $guid ) = @_;
    # retrieve a fact
    return $fact;
  }

  sub delete {
    my ( $self, $guid ) = @_;
    # delete a fact;
    return;
  }

  sub iterator {
    my ( $self ) = @_;
    # get iterator as Data::Stream::Bulk object
    return $iterator;
  }

  sub initialize {
    my ($self, @fact_classes) = @_;
    # prepare backend to store data (e.g. create database, etc.)
    return;
  }

DESCRIPTION ^

This describes the interface for storing and retrieving facts. Implementations must provide the store, extract, delete, iterator and initialize methods. initialize must be idempotent. iterator must return a Data::Stream::Bulk object.

AUTHORS ^

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2012 by David Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
syntax highlighting: