IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 6, 2011, 11:00:22 AM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/ippTasks/diskbalance.pro

    r31644 r32337  
    7575  book listpage balanceControl control
    7676  echo "balance so_ids: $BALANCE_SO_ID_START $BALANCE_SO_ID_RANGE"
     77  echo "targetting:     $BALANCE_TARGET"
    7778end
    7879
     
    8182  echo "$N pages in book"
    8283  book listbook balancePending
     84end
     85
     86macro set.balance.target
     87 if ($0 != 2)
     88   echo "USAGE: set.balance.target (DESTINATION|SOURCE)"
     89   break
     90 end
     91 $BALANCE_TARGET = $1
    8392end
    8493
     
    95104$BALANCE_LIMIT       = 500
    96105$BALANCE_OFFSET      = 0
     106$BALANCE_TARGET      = "SOURCE"
    97107# Select Nebulous objects which should be shuffled
    98108task           balance.load
     
    180190
    181191  task.exec
     192    # if we are unable to run the 'exec', use a long retry time
     193    periods -exec 5
     194
    182195    book npages balancePending -var N
    183196    if ($NETWORK == 0) break
    184     if ($N == 0)
    185         periods -exec 5
    186         break
    187     end
    188     # Reset the speed if we're doing something
    189     periods -exec 0.5
     197    if ($N == 0) break
    190198
    191199    # look for new objects in balancePending
     
    197205    book getword balancePending $pageName key              -var KEY
    198206    book getword balancePending $pageName source_name      -var SOURCE
     207    book getword balancePending $pageName source_host      -var SOURCE_HOST
    199208    book getword balancePending $pageName destination_name -var DESTINATION
    200209    book getword balancePending $pageName destination_host -var DEST_HOST
    201210    # Fix this with multihost restriction when possible.
    202     set.host.for.balance $DEST_HOST
     211    if ("$BALANCE_TARGET" == "DESTINATION")
     212       set.host.for.balance $DEST_HOST
     213    else
     214       set.host.for.balance $SOURCE_HOST
     215    end
     216   
    203217
    204218    stdout NULL
     
    214228        echo command $run
    215229    end
     230    periods -exec 0.05
    216231    command $run
    217232  end
    218233
    219234  # default exit status
    220   task.exit default
     235  task.exit     default
    221236    process_exit balancePending $options:0 $JOB_STATUS
    222237  end
Note: See TracChangeset for help on using the changeset viewer.