NAME
Kafka::MockIO - object interface to simulate the socket communications with the Apache Kafka server.
VERSION
This documentation refers to Kafka::MockIO version 0.800_2 .
DESCRIPTION
This module is not a user module.
The main features of the Kafka::MockIO class are:
Emulates an object oriented model of communication (Kafka::IO class).
Simplistically emulates interaction with kafka server.
Examples see t/??_mock_io.t.
EXPORT
These variables are the constants and never change their values.
Use Kafka::MockIO only with the following information:
$PARTITION
Partition number.
$KAFKA_MOCK_SERVER_PORT
$KAFKA_MOCK_SERVER_PORT is the default Apache Kafka server port that can be imported from the Kafka module and = 9092.
FUNCTIONS
The following methods are defined for the Kafka::MockIO class:
override
Override the Kafka::IO class methods.
restore
Restore the Kafka::IO class methods.
add_special_case( $cases )
Adds special cases for use in the simulation of interaction with kafka server.
This function take argument. The following argument is currently recognized:
$cases-
$casesis a reference to the hash representing the special cases.The keys of the hash should be binary-encoded query string to kafka server. The values of each key must be encoded binary string of the expected response.
del_special_case( $encoded_request )
Removes the special case.
This function take argument. The following argument is currently recognized:
special_cases
Returns a reference to a hash of special cases.
The keys of the hash are binary strings encoded requests to kafka server. The value of each key is encoded binary string of the expected response.
CONSTRUCTOR
new
Constructor emulation (Kafka::IO-new>).
METHODS
The following methods are defined for the Kafka::MockIO class:
send
Method emulation (Kafka::IO::send).
receive
Method emulation (Kafka::IO::receive).
close
Method emulation (Kafka::IO::close).
is_alive
Method emulation (Kafka::IO::is_alive).
DIAGNOSTICS
Error diagnosis emulated methods corresponds to the work of class Kafka::IO.
SEE ALSO
The basic operation of the Kafka package modules:
Kafka - constants and messages used by the Kafka package modules.
Kafka::Connection - interface to connect to a Kafka cluster.
Kafka::Producer - interface for producing client.
Kafka::Consumer - interface for consuming client.
Kafka::Message - interface to access Kafka message properties.
Kafka::Int64 - functions to work with 64 bit elements of the protocol on 32 bit systems.
Kafka::Protocol - functions to process messages in the Apache Kafka's Protocol.
Kafka::IO - low level interface for communication with Kafka server.
Kafka::Internals - Internal constants and functions used by several package modules.
A wealth of detail about the Apache Kafka and the Kafka Protocol:
Main page at http://kafka.apache.org/
Kafka Protocol at https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol
AUTHOR
Sergey Gladkov, <sgladkov@trackingsoft.com>
CONTRIBUTORS
Alexander Solovey
Jeremy Jordan
Vlad Marchenko
COPYRIGHT AND LICENSE
Copyright (C) 2012-2013 by TrackingSoft LLC.
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic at http://dev.perl.org/licenses/artistic.html.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.