You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2012/01/02 18:01:30 UTC
[lucy-commits] svn commit: r1226473 - in /incubator/lucy/trunk/perl:
lib/LucyX/Remote/ClusterSearcher.pm lib/LucyX/Remote/SearchClient.pm
lib/LucyX/Remote/SearchServer.pm t/510-remote_search.t
t/550-cluster_searcher.t
Author: nwellnhof
Date: Mon Jan 2 17:01:30 2012
New Revision: 1226473
URL: http://svn.apache.org/viewvc?rev=1226473&view=rev
Log:
Remove SearchServer password
On Marvin's request
Modified:
incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm
incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm
incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm
incubator/lucy/trunk/perl/t/510-remote_search.t
incubator/lucy/trunk/perl/t/550-cluster_searcher.t
Modified: incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm?rev=1226473&r1=1226472&r2=1226473&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm (original)
+++ incubator/lucy/trunk/perl/lib/LucyX/Remote/ClusterSearcher.pm Mon Jan 2 17:01:30 2012
@@ -25,7 +25,6 @@ use Scalar::Util qw( reftype );
# Inside-out member vars.
our %shards;
our %num_shards;
-our %password;
our %starts;
our %doc_max;
@@ -34,12 +33,10 @@ use IO::Socket::INET;
sub new {
my ( $either, %args ) = @_;
my $addrs = delete $args{shards};
- my $password = delete $args{password};
my $self = $either->SUPER::new(%args);
confess("'shards' must be an arrayref")
unless reftype($addrs) eq 'ARRAY';
$num_shards{$$self} = scalar @$addrs;
- $password{$$self} = $password;
# Establish connections.
my @shards;
@@ -59,7 +56,7 @@ sub new {
$shards{$$self} = \@shards;
# Handshake with servers.
- my %handshake_args = ( password => $password, _action => 'handshake' );
+ my %handshake_args = ( _action => 'handshake' );
my $responses = $self->_multi_rpc( \%handshake_args );
for my $response (@$responses) {
confess unless $response;
@@ -84,7 +81,6 @@ sub DESTROY {
$self->close if defined $shards{$$self};
delete $shards{$$self};
delete $num_shards{$$self};
- delete $password{$$self};
delete $starts{$$self};
delete $doc_max{$$self};
$self->SUPER::DESTROY;
@@ -400,11 +396,6 @@ B<schema> - A Schema, which must match t
B<shards> - An array of host:port pairs running LucyX::Remote::SearchServer
instances, which identifying the shards that make up the composite index.
-=item *
-
-B<password> - Optional password to be supplied to the SearchServers when
-initializing socket connections.
-
=back
=cut
Modified: incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm?rev=1226473&r1=1226472&r2=1226473&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm (original)
+++ incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchClient.pm Mon Jan 2 17:01:30 2012
@@ -23,7 +23,6 @@ use Storable qw( nfreeze thaw );
# Inside-out member vars.
our %peer_address;
-our %password;
our %sock;
use IO::Socket::INET;
@@ -31,10 +30,8 @@ use IO::Socket::INET;
sub new {
my ( $either, %args ) = @_;
my $peer_address = delete $args{peer_address};
- my $password = delete $args{password};
my $self = $either->SUPER::new(%args);
$peer_address{$$self} = $peer_address;
- $password{$$self} = $password;
# Establish a connection.
my $sock = $sock{$$self} = IO::Socket::INET->new(
@@ -43,7 +40,7 @@ sub new {
);
confess("No socket: $!") unless $sock;
$sock->autoflush(1);
- my %handshake_args = ( _action => 'handshake', password => $password );
+ my %handshake_args = ( _action => 'handshake' );
my $response = $self->_rpc( \%handshake_args );
confess("Failed to connect") unless $response;
@@ -54,7 +51,6 @@ sub DESTROY {
my $self = shift;
$self->close if defined $sock{$$self};
delete $peer_address{$$self};
- delete $password{$$self};
delete $sock{$$self};
$self->SUPER::DESTROY;
}
@@ -179,11 +175,6 @@ Constructor. Takes hash-style params.
B<peer_address> - The name/IP and the port number which the client should
attempt to connect to.
-=item *
-
-B<password> - Optional password to be supplied to the SearchServer when
-initializing socket connection.
-
=back
=cut
Modified: incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm?rev=1226473&r1=1226472&r2=1226473&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm (original)
+++ incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm Mon Jan 2 17:01:30 2012
@@ -24,7 +24,6 @@ use Scalar::Util qw( reftype );
# Inside-out member vars.
our %searcher;
-our %password;
use IO::Socket::INET;
use IO::Select;
@@ -32,11 +31,8 @@ use IO::Select;
sub new {
my ( $either, %args ) = @_;
my $searcher = delete $args{searcher};
- my $password = delete $args{password};
my $self = $either->SUPER::new(%args);
$searcher{$$self} = $searcher;
- confess("Missing required param 'password'") unless defined $password;
- $password{$$self} = $password;
return $self;
}
@@ -44,7 +40,6 @@ sub new {
sub DESTROY {
my $self = shift;
delete $searcher{$$self};
- delete $password{$$self};
$self->SUPER::DESTROY;
}
@@ -140,13 +135,6 @@ sub serve_rpc {
sub do_handshake {
my ( $self, $args ) = @_;
my $retval = 1;
- if ( defined $password{$$self} ) {
- if ( !defined $args->{password}
- || $password{$$self} ne $args->{password} )
- {
- $retval = 0;
- }
- }
return { retval => $retval };
}
@@ -220,7 +208,6 @@ distributed across multiple nodes, each
my $search_server = LucyX::Remote::SearchServer->new(
searcher => $searcher, # required
- password => $pass, # optional
);
Constructor. Takes hash-style parameters.
@@ -232,11 +219,6 @@ Constructor. Takes hash-style parameter
B<searcher> - the L<Searcher|Lucy::Search::IndexSearcher> that the SearchServer
will wrap.
-=item *
-
-B<password> - an optional password which, if supplied, must also be supplied
-by clients.
-
=back
=head2 serve
Modified: incubator/lucy/trunk/perl/t/510-remote_search.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/510-remote_search.t?rev=1226473&r1=1226472&r2=1226473&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/510-remote_search.t (original)
+++ incubator/lucy/trunk/perl/t/510-remote_search.t Mon Jan 2 17:01:30 2012
@@ -72,7 +72,6 @@ else {
my $searcher = Lucy::Search::IndexSearcher->new( index => $folder );
my $server = LucyX::Remote::SearchServer->new(
searcher => $searcher,
- password => 'foo',
);
$server->serve( port => $PORT_NUM );
exit(0);
@@ -93,7 +92,6 @@ else {
my $searchclient = LucyX::Remote::SearchClient->new(
schema => SortSchema->new,
peer_address => "localhost:$PORT_NUM",
- password => 'foo',
);
is( $searchclient->doc_freq( field => 'content', term => 'x' ),
Modified: incubator/lucy/trunk/perl/t/550-cluster_searcher.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/550-cluster_searcher.t?rev=1226473&r1=1226472&r2=1226473&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/550-cluster_searcher.t (original)
+++ incubator/lucy/trunk/perl/t/550-cluster_searcher.t Mon Jan 2 17:01:30 2012
@@ -84,7 +84,6 @@ for my $port (@ports) {
my $searcher = Lucy::Search::IndexSearcher->new( index => $folder );
my $server = LucyX::Remote::SearchServer->new(
searcher => $searcher,
- password => 'foo',
);
$server->serve( port => $port );
exit(0);
@@ -109,7 +108,6 @@ else {
my $solo_cluster_searcher = LucyX::Remote::ClusterSearcher->new(
schema => SortSchema->new,
shards => ["localhost:$ports[0]"],
- password => 'foo',
);
is( $solo_cluster_searcher->doc_freq( field => 'content', term => 'x' ),
@@ -129,7 +127,6 @@ is( $hits->total_hits, 1, "retrieved hit
my $cluster_searcher = LucyX::Remote::ClusterSearcher->new(
schema => SortSchema->new,
shards => [ map {"localhost:$_"} @ports ],
- password => 'foo',
);
$hits = $cluster_searcher->hits( query => 'b' );