Closed Abhishek-17 closed 9 years ago
Overall very good quality PR, but it needs a bit more tests as mentioned in inline comments.
Incorporating the above feedback, the following major changes have been made:
getConnection()
has been implemented in the LoggingClient.getChangesAsStream()
method. It was not useful as the response in this case is not a continuous stream but a JSON after which the connection gets closed. For filtered feed use the getChanges()
method.
Hi. I am working on a project under Google's summer of code program for Drupal which involves writing a PHP based replicator. This is the second set of changes enchancing the client in general and also for supporting the PHP implementation of the CouchDB replication protocol. The first set of changes have already been merged and can be seen by following pull/42 link.
The changes mainly now allow the client to read data from source CouchDb client in chunks and stream it to the target CouchDb client. This is mainly useful when the docs to be replicated have large attachments exceeding the space available locally on the drive. To do this I have added the ability in the StreamClient and the SocketClient to return the connection resource.
Let's go through the changes file by file:
transferChangedDocuments()
. This method transfers the missing revisions from the current source database to the target database.getChangesAsStream()
. This method returns the resource from which changes feed can be read continuously.getOptions()
. It's the getter for connection options.getConnection()
. This method is expected to return a connection resource which can be used to read or write in small chunks.getConnection()
. This method returns the connection resource after setting up the connection. This resource can be used for reading or writing data in chunks. This must be done without much delay as the connection might get closed.getConnection()
. This method returns the connection resource after setting up the connection. This resource can be used only for reading data in chunks.testTransferChangedDocuments()
. This is the test fortransferChangedDocuments()
.testGetChangesAsStream()
. This is the test forgetChangesAsStream()
.if
,for
,while
etc.