Examples of unassigned()


Examples of org.apache.accumulo.server.master.state.TableCounts.unassigned()

          for (Entry<Text,TableCounts> entry : watcher.getStats().entrySet()) {
            Text tableId = entry.getKey();
            TableCounts counts = entry.getValue();
            TableState tableState = manager.getTableState(tableId.toString());
            if (tableState != null && tableState.equals(TableState.ONLINE)) {
              result += counts.unassigned() + counts.assignedToDeadServers();
            }
          }
        }
        break;
      case SAFE_MODE:
View Full Code Here

Examples of org.apache.accumulo.server.master.state.TableCounts.unassigned()

          for (Entry<Text,TableCounts> entry : watcher.getStats().entrySet()) {
            Text tableId = entry.getKey();
            TableCounts counts = entry.getValue();
            TableState tableState = manager.getTableState(tableId.toString());
            if (tableState != null && tableState.equals(TableState.ONLINE)) {
              result += counts.unassigned() + counts.assignedToDeadServers() + counts.assigned();
            }
          }
        }
        break;
      case SAFE_MODE:
View Full Code Here

Examples of org.apache.accumulo.server.master.state.TableCounts.unassigned()

        for (Entry<Text,TableCounts> entry : watcher.getStats().entrySet()) {
          Text tableId = entry.getKey();
          TableCounts counts = entry.getValue();
          TableState tableState = manager.getTableState(tableId.toString());
          if (tableState != null && tableState.equals(TableState.ONLINE)) {
            result += counts.unassigned() + counts.assignedToDeadServers() + counts.assigned();
          }
        }
      }
    } else if (getMasterState().equals(MasterState.SAFE_MODE)) {
      // Count offline tablets for the METADATA table
View Full Code Here

Examples of org.elasticsearch.cluster.routing.MutableShardRouting.unassigned()

                            routingNodes.assign(new MutableShardRouting(candidate.index(), candidate.id(), lowRoutingNode.nodeId(), candidate
                                    .currentNodeId(), candidate.restoreSource(), candidate.primary(), INITIALIZING, candidate.version() + 1), lowRoutingNode.nodeId());
                            routingNodes.relocate(candidate, lowRoutingNode.nodeId());

                        } else {
                            assert candidate.unassigned();
                            routingNodes.assign(candidate, routingNodes.node(minNode.getNodeId()).nodeId());
                        }
                        return true;

                    }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNodes.unassigned()

        if (!routingNodes.hasUnassigned()) {
            return changed;
        }

        Iterator<MutableShardRouting> unassignedIterator = routingNodes.unassigned().iterator();
        while (unassignedIterator.hasNext()) {
            MutableShardRouting shard = unassignedIterator.next();

            // pre-check if it can be allocated to any node that currently exists, so we won't list the store for it for nothing
            boolean canBeAllocatedToAtLeastOneNode = false;
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNodes.unassigned()

        boolean changed = false;
        DiscoveryNodes nodes = allocation.nodes();
        RoutingNodes routingNodes = allocation.routingNodes();

        // First, handle primaries, they must find a place to be allocated on here
        Iterator<MutableShardRouting> unassignedIterator = routingNodes.unassigned().iterator();
        while (unassignedIterator.hasNext()) {
            MutableShardRouting shard = unassignedIterator.next();

            if (!shard.primary()) {
                continue;
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNodes.unassigned()

        if (!routingNodes.hasUnassigned()) {
            return changed;
        }

        // Now, handle replicas, try to assign them to nodes that are similar to the one the primary was allocated on
        unassignedIterator = routingNodes.unassigned().iterator();
        while (unassignedIterator.hasNext()) {
            MutableShardRouting shard = unassignedIterator.next();

            // pre-check if it can be allocated to any node that currently exists, so we won't list the store for it for nothing
            boolean canBeAllocatedToAtLeastOneNode = false;
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNodes.unassigned()

        RoutingNodes routingNodes = allocation.routingNodes();


        List<RoutingNode> nodes = routingNodes.sortedNodesLeastToHigh();

        Iterator<MutableShardRouting> unassignedIterator = routingNodes.unassigned().iterator();
        int lastNode = 0;

        while (unassignedIterator.hasNext()) {
            MutableShardRouting shard = unassignedIterator.next();
            // do the allocation, finding the least "busy" node
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNodes.unassigned()

                }
            }
        }

        // allocate all the unassigned shards above the average per node.
        for (Iterator<MutableShardRouting> it = routingNodes.unassigned().iterator(); it.hasNext(); ) {
            MutableShardRouting shard = it.next();
            // go over the nodes and try and allocate the remaining ones
            for (RoutingNode routingNode : routingNodes.sortedNodesLeastToHigh()) {
                if (nodeAllocations.canAllocate(shard, routingNode, allocation).allocate()) {
                    changed = true;
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNodes.unassigned()

        routingNodes = clusterState.routingNodes();

        for (RoutingNode routingNode : routingNodes) {
            assertThat(routingNode.numberOfShardsWithState(STARTED), equalTo(1));
        }
        assertThat(routingNodes.unassigned().size(), equalTo(2));
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.