db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "V.Narayanan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2954) Add commands to NetworkServerControl for interacting with the replication functionality
Date Fri, 20 Jul 2007 09:11:06 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514156

V.Narayanan commented on DERBY-2954:

I have started work on the fail-over command.

As a first step I was looking at how to introduce this new command
in the NetworkServerControl class.

I envisaged the following steps and started working on this issue.

1) Add a entry for the replication base command in the COMMANDS String array.
2) Add the integer translation for the command as COMMAND_REPLICATION and assign 
   it the value of 11.
3) Catch this in executeWork() and call the failover handler(does not exist yet)

Simple as the series of steps seem I ran into complications due to the following

As I understand the process of command translation the findCommands
method returns the integer representation of the command that is entered.

This method basically returns the index of the COMMANDS array at which the
string for the command is found.

All was well until I tried to give the replication command a value of 11
and followed the modifications steps listed above.

I realized that 10 was a command that was not present in the COMMAND array.
It refers to COMMAND_PROPERTIES which refers to the command the network
server receives from the client.

This seems to be a hard-coded value which I could not modify by tweaking

1) I see the simplest way of fixing this as being replacing the 10th index in the
    array to be an empty String "" and starting replication commands from index 11.
    In this way even if you pass an empty string a command expected message would be 
    thrown without any other tweaks.

2) Another way would be replcation the 10 index with the INVALID command and mapping 
    this INVALID command to -1 which refers to COMMAND_UNKNOWN and the starting the 
    replication commands from the 11th index.

I like 1 better and am going to go ahead and handle this issue this way unless I 
receive any objection from the community.

> Add commands to NetworkServerControl for interacting with the replication functionality
> ---------------------------------------------------------------------------------------
>                 Key: DERBY-2954
>                 URL: https://issues.apache.org/jira/browse/DERBY-2954
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions:
>            Reporter: V.Narayanan
>            Assignee: V.Narayanan

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message