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 07:09:16 UTC

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

     [ 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