You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Koji Sekiguchi (JIRA)" <ji...@apache.org> on 2010/08/14 04:14:16 UTC

[jira] Created: (SOLR-2046) add a function to set curl_url in scripts-util

add a function to set curl_url in scripts-util
----------------------------------------------

                 Key: SOLR-2046
                 URL: https://issues.apache.org/jira/browse/SOLR-2046
             Project: Solr
          Issue Type: Improvement
          Components: replication (scripts)
    Affects Versions: 1.4.1
            Reporter: Koji Sekiguchi
            Priority: Trivial


abc/abo/commit/optimize/readercycle scripts have the following identical snippet to set curl_url:

{code}
if [[ -n ${solr_url} ]]
then
  curl_url=${solr_url}
else
  if [[ -z ${solr_port} ]]
  then
    echo "Solr port number missing in $confFile or command line."
    echo "$USAGE"
    exit 1
  fi

  # use default hostname if not specified
  if [[ -z ${solr_hostname} ]]
  then
    solr_hostname=localhost
  fi

  # use default webapp name if not specified
  if [[ -z ${webapp_name} ]]
  then
    webapp_name=solr
  fi
  curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
fi
{code}

I think it should be moved to scripts-util in order to improve readability/maintainability.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (SOLR-2046) add a function to set curl_url in scripts-util

Posted by "Koji Sekiguchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Sekiguchi updated SOLR-2046:
---------------------------------

    Attachment: SOLR-2046.patch

Attached the patch. I moved above common snippet to scripts-url as a function curlUrl. I did some minor fix (typo in help massage, remove shell var that never used).  Worked well on my Mac.

BTW, I realized that readercycle script is almost same as commit and it is somewhat old? Because the check code of commit request is:

{code}
# check status of commit request                                                
echo $rs | grep '<response.*status="0"' > /dev/null 2>&1
  :
{code}

but in commit script, the check code is:

{code}
# check status of commit request - original format                              
echo $rs | grep '<result.*status="0"' > /dev/null 2>&1
  :
{code}

readercycle sees "<*response* status="0">" while commit sees "<*result* status="0">"... And commit script then check "new format xml" but readercycle never check "new format". So, readercycle always fails (I made fix it in the patch).

Can we delete readercycle? Or am I missing something?

> add a function to set curl_url in scripts-util
> ----------------------------------------------
>
>                 Key: SOLR-2046
>                 URL: https://issues.apache.org/jira/browse/SOLR-2046
>             Project: Solr
>          Issue Type: Improvement
>          Components: replication (scripts)
>    Affects Versions: 1.4.1
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>         Attachments: SOLR-2046.patch
>
>
> abc/abo/commit/optimize/readercycle scripts have the following identical snippet to set curl_url:
> {code}
> if [[ -n ${solr_url} ]]
> then
>   curl_url=${solr_url}
> else
>   if [[ -z ${solr_port} ]]
>   then
>     echo "Solr port number missing in $confFile or command line."
>     echo "$USAGE"
>     exit 1
>   fi
>   # use default hostname if not specified
>   if [[ -z ${solr_hostname} ]]
>   then
>     solr_hostname=localhost
>   fi
>   # use default webapp name if not specified
>   if [[ -z ${webapp_name} ]]
>   then
>     webapp_name=solr
>   fi
>   curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
> fi
> {code}
> I think it should be moved to scripts-util in order to improve readability/maintainability.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Resolved: (SOLR-2046) add a function to set curl_url in scripts-util

Posted by "Koji Sekiguchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Sekiguchi resolved SOLR-2046.
----------------------------------

         Assignee: Koji Sekiguchi
    Fix Version/s: 3.1
                   4.0
       Resolution: Fixed

trunk: Committed revision 990160.
branch_3x: Committed revision 990162.


> add a function to set curl_url in scripts-util
> ----------------------------------------------
>
>                 Key: SOLR-2046
>                 URL: https://issues.apache.org/jira/browse/SOLR-2046
>             Project: Solr
>          Issue Type: Improvement
>          Components: replication (scripts)
>    Affects Versions: 1.4.1
>            Reporter: Koji Sekiguchi
>            Assignee: Koji Sekiguchi
>            Priority: Trivial
>             Fix For: 3.1, 4.0
>
>         Attachments: SOLR-2046.patch, SOLR-2046.patch, SOLR-2046.patch, SOLR-2046.patch
>
>
> abc/abo/commit/optimize/readercycle scripts have the following identical snippet to set curl_url:
> {code}
> if [[ -n ${solr_url} ]]
> then
>   curl_url=${solr_url}
> else
>   if [[ -z ${solr_port} ]]
>   then
>     echo "Solr port number missing in $confFile or command line."
>     echo "$USAGE"
>     exit 1
>   fi
>   # use default hostname if not specified
>   if [[ -z ${solr_hostname} ]]
>   then
>     solr_hostname=localhost
>   fi
>   # use default webapp name if not specified
>   if [[ -z ${webapp_name} ]]
>   then
>     webapp_name=solr
>   fi
>   curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
> fi
> {code}
> I think it should be moved to scripts-util in order to improve readability/maintainability.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (SOLR-2046) add a function to set curl_url in scripts-util

Posted by "Koji Sekiguchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Sekiguchi updated SOLR-2046:
---------------------------------

    Attachment: SOLR-2046.patch

A new patch attached. In this patch, I'm going to remove readercycle script. I'll commit in a few days.

> add a function to set curl_url in scripts-util
> ----------------------------------------------
>
>                 Key: SOLR-2046
>                 URL: https://issues.apache.org/jira/browse/SOLR-2046
>             Project: Solr
>          Issue Type: Improvement
>          Components: replication (scripts)
>    Affects Versions: 1.4.1
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>         Attachments: SOLR-2046.patch, SOLR-2046.patch, SOLR-2046.patch
>
>
> abc/abo/commit/optimize/readercycle scripts have the following identical snippet to set curl_url:
> {code}
> if [[ -n ${solr_url} ]]
> then
>   curl_url=${solr_url}
> else
>   if [[ -z ${solr_port} ]]
>   then
>     echo "Solr port number missing in $confFile or command line."
>     echo "$USAGE"
>     exit 1
>   fi
>   # use default hostname if not specified
>   if [[ -z ${solr_hostname} ]]
>   then
>     solr_hostname=localhost
>   fi
>   # use default webapp name if not specified
>   if [[ -z ${webapp_name} ]]
>   then
>     webapp_name=solr
>   fi
>   curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
> fi
> {code}
> I think it should be moved to scripts-util in order to improve readability/maintainability.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (SOLR-2046) add a function to set curl_url in scripts-util

Posted by "Koji Sekiguchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Sekiguchi updated SOLR-2046:
---------------------------------

    Attachment: SOLR-2046.patch

New patch attached. I added a function dataDir for the following common snippet:

{code}
# use default value for data_dir if not specified                               
# relative path starts at ${solr_root}                                          
if [[ -z ${data_dir} ]]
then
    data_dir=${solr_root}/data
elif [[ "`echo ${data_dir}|cut -c1`" != "/" ]]
then
    data_dir=${solr_root}/${data_dir}
fi
{code}

Also further minor fix typo added in help messages.

> add a function to set curl_url in scripts-util
> ----------------------------------------------
>
>                 Key: SOLR-2046
>                 URL: https://issues.apache.org/jira/browse/SOLR-2046
>             Project: Solr
>          Issue Type: Improvement
>          Components: replication (scripts)
>    Affects Versions: 1.4.1
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>         Attachments: SOLR-2046.patch, SOLR-2046.patch
>
>
> abc/abo/commit/optimize/readercycle scripts have the following identical snippet to set curl_url:
> {code}
> if [[ -n ${solr_url} ]]
> then
>   curl_url=${solr_url}
> else
>   if [[ -z ${solr_port} ]]
>   then
>     echo "Solr port number missing in $confFile or command line."
>     echo "$USAGE"
>     exit 1
>   fi
>   # use default hostname if not specified
>   if [[ -z ${solr_hostname} ]]
>   then
>     solr_hostname=localhost
>   fi
>   # use default webapp name if not specified
>   if [[ -z ${webapp_name} ]]
>   then
>     webapp_name=solr
>   fi
>   curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
> fi
> {code}
> I think it should be moved to scripts-util in order to improve readability/maintainability.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (SOLR-2046) add a function to set curl_url in scripts-util

Posted by "Koji Sekiguchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Sekiguchi updated SOLR-2046:
---------------------------------

    Attachment: SOLR-2046.patch

> add a function to set curl_url in scripts-util
> ----------------------------------------------
>
>                 Key: SOLR-2046
>                 URL: https://issues.apache.org/jira/browse/SOLR-2046
>             Project: Solr
>          Issue Type: Improvement
>          Components: replication (scripts)
>    Affects Versions: 1.4.1
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>         Attachments: SOLR-2046.patch, SOLR-2046.patch, SOLR-2046.patch, SOLR-2046.patch
>
>
> abc/abo/commit/optimize/readercycle scripts have the following identical snippet to set curl_url:
> {code}
> if [[ -n ${solr_url} ]]
> then
>   curl_url=${solr_url}
> else
>   if [[ -z ${solr_port} ]]
>   then
>     echo "Solr port number missing in $confFile or command line."
>     echo "$USAGE"
>     exit 1
>   fi
>   # use default hostname if not specified
>   if [[ -z ${solr_hostname} ]]
>   then
>     solr_hostname=localhost
>   fi
>   # use default webapp name if not specified
>   if [[ -z ${webapp_name} ]]
>   then
>     webapp_name=solr
>   fi
>   curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
> fi
> {code}
> I think it should be moved to scripts-util in order to improve readability/maintainability.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org