Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created January 28, 2016 22:54
Show Gist options
  • Select an option

  • Save ableasdale/3bcb218e875efde3c1cc to your computer and use it in GitHub Desktop.

Select an option

Save ableasdale/3bcb218e875efde3c1cc to your computer and use it in GitHub Desktop.
Rebalancer Preview
element table { attribute border {1},
element tr { element th {"Source"}, element th {"Active"}, element th {"Deleted"}, element th {"Rebalancing"}, element th {"Total to be moved"}},
for $f in xdmp:document-get("/path/to/result.xml")/result/*:forest-counts
return
element tr { element td {$f/*:forest-name/fn:string(.)} , element td {fn:sum ($f//*:active-fragment-count)},
element td {fn:sum ($f//*:deleted-fragment-count)},
element td {
fn:string-join(
for $c in $f//*:rebalance-fragment-count[*:fragment-count != 0] return ($c/*:rebalance-destination || ": " || $c/*:fragment-count), " | ")},
element td {fn:sum($f//*:rebalance-fragment-count[*:fragment-count != 0]/*:fragment-count)}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment