dlmarion commented on PR #4329:
URL: https://github.com/apache/accumulo/pull/4329#issuecomment-1973741709

   > Was looking at how the script uses NUM_TSERVERS and saw the following line
   > 
   > 
https://github.com/apache/accumulo/blob/4c4d4c6ec4f31d365d4ef638a09cf4cc024ca625/assemble/bin/accumulo-cluster#L142
   > 
   > I noticed its different than the following compactor line. However not 
sure if that matters because I don't understand what the line is doing. Does it 
need to be the same? What is that line doing?
   
   So, first, let's talk about how it's used. It's used 
[here](https://github.com/apache/accumulo/blob/2.1/assemble/bin/accumulo-service#L76)
 in 2.1 for helping to determine the name of the output file. In 1.10 and 
earlier versions using Log4J v1, it was used like 
[this](https://github.com/apache/accumulo/blob/rel/1.10.4/assemble/conf/templates/generic_logger.xml#L23).
 
   
   Regarding the the lines you referenced in the `accumulo-cluster`:
   ```
     for ((inst_id = 1; inst_id <= last_instance_id; inst_id++)); do
       ACCUMULO_SERVICE_INSTANCE=""
       [[ $service == "tserver" && ${NUM_TSERVERS:-1} -gt 1 ]] && 
ACCUMULO_SERVICE_INSTANCE=${inst_id}
       [[ $service == "compactor" ]] && 
ACCUMULO_SERVICE_INSTANCE="${inst_id}_${5}"
       [[ $service == "sserver" && ${NUM_SSERVERS:-1} -gt 1 ]] && 
ACCUMULO_SERVICE_INSTANCE=${inst_id}
   ```
   
   In the case of NUM_TSERVERS and NUM_SSERVERS, they are setting 
`ACCUMULO_SERVICE_INSTANCE` to the current `inst_id` when NUM_TSERVERS and 
NUM_SSERVERS is larger than one. When the value of `NUMX` is 1, then the 
logfile name will not have a number (e.g. `sserver.out`) and when the value of 
`NUMX` is larger than 1, then the logfile name will have a number (e.g. 
`sserver1.log`, `sserver2.log`, ...)
   
   In the case of Compactors, it always sets `ACCUMULO_SERVICE_INSTANCE` to 
`${inst_id}_${5}`. The fifth parameter in this case is the group name. So 
compactors will have output file names of the pattern `compactor1_default.out` 
for example.
   
   In elasticity the code looks like below, so the order has changed a little 
with respect to resource group and instance number:
   ```
     for ((inst_id = 1; inst_id <= last_instance_id; inst_id++)); do
       ACCUMULO_SERVICE_INSTANCE=""
       [[ $service == "tserver" && ${NUM_TSERVERS:-1} -gt 1 ]] && 
ACCUMULO_SERVICE_INSTANCE="_${group}_${inst_id}"
       [[ $service == "compactor" ]] && 
ACCUMULO_SERVICE_INSTANCE="_${group}_${inst_id}"
       [[ $service == "sserver" && ${NUM_SSERVERS:-1} -gt 1 ]] && 
ACCUMULO_SERVICE_INSTANCE="_${group}_${inst_id}"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to