GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DBIX::DBHRESOLVER::STRATEGY::RANGE (3)

.ds Aq ’

NAME

DBIx::DBHResolver::Strategy::Range - Range based strategy

CONTENTS

SYNOPSIS



  use DBIx::DBHResolver;
  use DBIx::DBHResolver::Strategy::Range;

  my $day = 24 * 60 * 60;
  my $resolver = DBIx::DBHResolver->new;
  $resolver->config(+{
    clusters => +{
      TIMELINE => +{
        nodes => [qw/TIMELINE_ARCHIVE TIMELINE_YEAR TIMELINE_LATEST/],
        strategy => Range,
        strategy_config => [
          TIMELINE_ARCHIVE => [ > => 365 ],
          TIMELINE_THIS_YEAR => [ > => 30, <= => 365 ],
          TIMELINE_LATEST => [ >= => 0, <= => 30  ],
        ],
      }
    },
    connect_info => +{
      TIMELINE_ARCHIVE => +{ ... },
      TIMELINE_THIS_YEAR => +{ ... },
      TIMELINE_LATEST => +{ ... },
    }
  });

  my $strategy = DBIx::DBHResolver::Strategy::List;

  $strategy->connect_info( $resolver, TIMELINE, 380 ); # return TIMELINE_ARCHIVEs connect_info
  $strategy->connect_info( $resolver, TIMELINE, 55 ); # return TIMELINE_YEARs connect_info
  $strategy->connect_info( $resolver, TIMELINE, 0 ); # return TIMELINE_LATESTs connect_info



DESCRIPTION

This module is range based sharding strategy. Supported operator are ’>’, ’>=’ ’<’, ’<=’.

METHODS

connect_info( CW$resolver, CW$node_or_cluster, CW$args )

Return connect_info hash ref.

resolve( CW$resolver, CW$node_or_cluster, CW$key, CW$args )

Return resolved node_or_cluster name.

AUTHOR

Toru Yamaguchi <zigorou@dena.jp<gt>

LICENSE

This module is licensed under the same terms as Perl itself.

SEE ALSO

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DBIX::DBHRESOLVER::STRATEGY::RANGE (3) 2012-10-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.