.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::TestServer 3pm" .TH Search::Elasticsearch::TestServer 3pm "2016-12-17" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Search::Elasticsearch::TestServer \- A helper class to launch Elasticsearch nodes .SH "VERSION" .IX Header "VERSION" version 5.01 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Search::Elasticsearch; \& use Search::Elasticsearch::TestServer; \& \& my $server = Search::Elasticsearch::TestServer\->new( \& es_home => \*(Aq/path/to/elasticsearch\*(Aq, \& ); \& \& my $nodes = $server\->start; \& my $es = Search::Elasticsearch\->new( nodes => $nodes ); \& # run tests \& $server\->shutdown; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Search::Elasticsearch::TestServer class can be used to launch one or more instances of Elasticsearch for testing purposes. The nodes will be shutdown automatically. .SH "METHODS" .IX Header "METHODS" .ie n .SS """new()""" .el .SS "\f(CWnew()\fP" .IX Subsection "new()" .Vb 7 \& my $server = Search::Elasticsearch::TestServer\->new( \& es_home => \*(Aq/path/to/elasticsearch\*(Aq, \& instances => 1, \& http_port => 9600, \& es_port => 9700, \& conf => [\*(Aqscript.disable_dynamic=false\*(Aq], \& ); .Ve .PP Params: .IP "\(bu" 4 \&\f(CW\*(C`es_home\*(C'\fR .Sp Required. Must point to the Elasticsearch home directory, which contains \&\f(CW\*(C`./bin/elasticsearch\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`instances\*(C'\fR .Sp The number of nodes to start. Defaults to 1 .IP "\(bu" 4 \&\f(CW\*(C`http_port\*(C'\fR .Sp The port to use for \s-1HTTP.\s0 If multiple instances are started, the \f(CW\*(C`http_port\*(C'\fR will be incremented for each subsequent instance. Defaults to 9600. .IP "\(bu" 4 \&\f(CW\*(C`es_port\*(C'\fR .Sp The port to use for Elasticsearch's internal transport. If multiple instances are started, the \f(CW\*(C`es_port\*(C'\fR will be incremented for each subsequent instance. Defaults to 9700 .IP "\(bu" 4 \&\f(CW\*(C`conf\*(C'\fR .Sp An array containing any extra startup options that should be passed to Elasticsearch. .ie n .SH """start()""" .el .SH "\f(CWstart()\fP" .IX Header "start()" .Vb 1 \& $nodes = $server\->start; .Ve .PP Starts the required instances and returns an array ref containing the \s-1IP\s0 and port of each node, suitable for passing to \*(L"\fInew()\fR\*(R" in Search::Elasticsearch: .PP .Vb 1 \& $es = Search::Elasticsearch\->new( nodes => $nodes ); .Ve .ie n .SH """shutdown()""" .el .SH "\f(CWshutdown()\fP" .IX Header "shutdown()" .Vb 1 \& $server\->shutdown; .Ve .PP Kills the running instances. This will be called automatically when \&\f(CW$server\fR goes out of scope or if the program receives a \f(CW\*(C`SIGINT\*(C'\fR. .SH "AUTHOR" .IX Header "AUTHOR" Clinton Gormley .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2016 by Elasticsearch \s-1BV.\s0 .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve