Examples of Slot


Examples of org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot

            LOG.trace(this + ": shared memory segment access is disabled.");
          }
          return null;
        }
        // Try to use an existing slot.
        Slot slot = allocSlotFromExistingShm(blockId);
        if (slot != null) {
          return slot;
        }
        // There are no free slots.  If someone is loading more slots, wait
        // for that to finish.
View Full Code Here

Examples of org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot

    while (true) {
      curPeer = nextDomainPeer();
      if (curPeer == null) break;
      if (curPeer.fromCache) remainingCacheTries--;
      DomainPeer peer = (DomainPeer)curPeer.peer;
      Slot slot = null;
      ShortCircuitCache cache = clientContext.getShortCircuitCache();
      try {
        MutableBoolean usedPeer = new MutableBoolean(false);
        slot = cache.allocShmSlot(datanode, peer, usedPeer,
            new ExtendedBlockId(block.getBlockId(), block.getBlockPoolId()),
View Full Code Here

Examples of org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot

              Map<Long, ShortCircuitReplica> evictableMmapped) {
            Assert.assertEquals(expectedOutstandingMmaps, numOutstandingMmaps);
            ShortCircuitReplica replica =
                replicas.get(ExtendedBlockId.fromExtendedBlock(block));
            Assert.assertNotNull(replica);
            Slot slot = replica.getSlot();
            if ((expectedIsAnchorable != slot.isAnchorable()) ||
                (expectedIsAnchored != slot.isAnchored())) {
              LOG.info("replica " + replica + " has isAnchorable = " +
                slot.isAnchorable() + ", isAnchored = " + slot.isAnchored() +
                ".  Waiting for isAnchorable = " + expectedIsAnchorable +
                ", isAnchored = " + expectedIsAnchored);
              return;
            }
            result.setValue(true);
View Full Code Here

Examples of org.eclipse.uml2.uml.Slot

      if (!constructorParameterNames.isEmpty()) {
        for (String constructorParameterName : constructorParameterNames) {
          logger.log(Level.FINE, "constructorParameterName: "
              + constructorParameterNames.toString());

          Slot slot = findSlotByName(constructorParameterName,
              enumLiteral);
          if (slot != null) {
            // We found a slot with the same name
            Property property = (Property) slot
                .getDefiningFeature();
            Type type = property.getType();
            chooseLiteralTypeAndAddToEnumConstantArguments(ast, ec,
                slot, type);
          } else {
View Full Code Here

Examples of org.getspout.spoutapi.gui.Slot

    if (!in.containsWidget(slot)) {
      return;
    }

    // Slot handling code goes here.
    Slot slot = (Slot) in.getWidget(this.slot);
    try {
      ItemStack stackOnCursor = p.getItemOnCursor();
      if (stackOnCursor == null) {
        stackOnCursor = new ItemStack(0);
      }
      ItemStack stackInSlot = slot.getItem();
      if ((stackOnCursor == null || stackOnCursor.getTypeId() == 0) && stackInSlot.getTypeId() == 0) {
        return; // Nothing to do
      }
      if (stackOnCursor.getTypeId() == 0 && stackInSlot.getTypeId() != 0 && button == 1) { // Split item
        int amountSlot = stackInSlot.getAmount() / 2;
        int amountCursor = stackInSlot.getAmount() - amountSlot;
        if (stackInSlot.getAmount() == 1) {
          amountSlot = 0;
          amountCursor = 1;
        }
        stackOnCursor = stackInSlot.clone();
        stackOnCursor.setAmount(amountCursor);
        stackInSlot.setAmount(amountSlot);
        if (amountSlot == 0) {
          stackInSlot = new ItemStack(0);
        }
        SlotEvent s = new SlotTakeEvent(p, slot, stackInSlot, !slot.onItemTake(stackOnCursor));
        Bukkit.getPluginManager().callEvent(s);
        if (!s.isCancelled()) {
          slot.setItem(stackInSlot);
        } else {
          slot.setDirty(true); // We need to tell the client that the operation was denied.
          return;
        }
      } else if (stackOnCursor != null && (stackInSlot.getTypeId() == 0 || (stackInSlot.getTypeId() == stackOnCursor.getTypeId() && stackInSlot.getDurability() == stackOnCursor.getDurability()))) { // Put item
        ItemStack toPut = stackOnCursor.clone();
        int putAmount = toPut.getAmount();
        if (button == 1) {
          putAmount = 1;
        }
        int amount = stackInSlot.getTypeId() == 0 ? 0 : stackInSlot.getAmount();
        amount += putAmount;
        int maxStackSize = toPut.getMaxStackSize();
        if (maxStackSize == -1) {
          maxStackSize = 64;
        }
        if (amount > maxStackSize) {
          putAmount -= amount - maxStackSize;
          amount = maxStackSize;
        }
        if (putAmount <= 0) {
          return;
        }
        toPut.setAmount(putAmount);
        SlotEvent s = new SlotPutEvent(p, slot, stackInSlot, !slot.onItemPut(toPut));
        Bukkit.getPluginManager().callEvent(s);
        if (!s.isCancelled()) {
          stackOnCursor.setAmount(stackOnCursor.getAmount() - putAmount);
          if (stackOnCursor.getAmount() == 0) {
            stackOnCursor = new ItemStack(0);
          }
          ItemStack put = toPut.clone();
          put.setAmount(amount);
          slot.setItem(put);
        } else {
          slot.setDirty(true); // We need to tell the client that the operation was denied.
        }
      } else if (stackOnCursor == null || stackOnCursor.getTypeId() == 0) { //Take item or shift click
        if (holdingShift) {
          slot.onItemShiftClicked();
          SlotEvent s = new SlotShiftClickEvent(p, slot);
          Bukkit.getPluginManager().callEvent(s);
        } else { // Take item
          SlotEvent s = new SlotTakeEvent(p, slot, stackInSlot, !slot.onItemTake(stackInSlot));
          Bukkit.getPluginManager().callEvent(s);
          if (!s.isCancelled()) {
            stackOnCursor = stackInSlot;
            slot.setItem(new ItemStack(0));
          } else {
            slot.setDirty(true); // We need to tell the client that the operation was denied.
          }
        }
      } else if (stackOnCursor.getTypeId() != stackInSlot.getTypeId() || stackOnCursor.getDurability() != stackInSlot.getDurability()) { // Exchange slot stack and cursor stack
        SlotEvent s = new SlotExchangeEvent(p, slot, stackInSlot, stackOnCursor.clone(), !slot.onItemExchange(stackInSlot, stackOnCursor.clone()));
        Bukkit.getPluginManager().callEvent(s);
        if (!s.isCancelled()) {
          slot.setItem(stackOnCursor.clone());
          stackOnCursor = stackInSlot;
        } else {
          slot.setDirty(true); // We need to tell the client that the operation was denied.
        }
      }

      if (stackOnCursor == null || stackOnCursor.getTypeId() == 0) {
        p.setItemOnCursor(null);
View Full Code Here

Examples of org.infoglue.deliver.applications.databeans.Slot

          {
            allowedNumberOfComponentsInt = -1;
          }
        }

          Slot slot = new Slot();
          slot.setId(slotId);
          slot.setInherit(inherit);
          slot.setDisableAccessControl(disableAccessControl);
          slot.setAllowedComponentsArray(allowedComponentNamesArray);
          slot.setDisallowedComponentsArray(disallowedComponentNamesArray);
          slot.setAllowedComponentGroupsArray(allowedComponentGroupNamesArray);
          slot.setAddComponentLinkHTML(addComponentLinkHTML);
          slot.setAddComponentText(addComponentText);
          slot.setAllowedNumberOfComponents(new Integer(allowedNumberOfComponentsInt));
         
          List subComponents = getComponentsWithXPP3(db, templateController, component, templateController.getSiteNodeId(), slotId);
          slot.setComponents(subComponents);
         
          component.getSlotList().add(slot);

          offset = slotStopIndex; // + 10;
        slotStartIndex = componentString.indexOf("<ig:slot", offset);
View Full Code Here

Examples of org.jpokemon.battle.slot.Slot

  public void serve(JSONObject request, Player player) throws ServiceException {
  }

  @Override
  public Turn getTurn() {
    Slot slot = battle.getSlot(slotId);

    return new RunTurn(battle, slot);
  }
View Full Code Here

Examples of org.spout.api.inventory.Slot

   * returns the slot that is currently selected on the quickbar
   *
   * @return slot selected
   */
  public Slot getSelectedSlot() {
    return new Slot(this, this.selected);
  }
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.views.model.Slot

    }

    private void addSlotControl(SlotControl control) {
        assert control != null;

        Slot slot = control.getSlot();

        visualMappingPanel.addConfigurationSetting(slot.getName(),
                control.asWidget());

        slotControlsByDataType.get(slot.getDataType()).add(control);
        slotToSlotControls.put(slot, control);
    }
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.visualization.model.Slot

            Memento child = entry.getValue();

            assert child.getFactoryId() != null : "factory id must not be null ("
                    + child + ")";

            Slot slot = configuration.getSlotById(slotId);
            ManagedVisualItemValueResolver resolver = visualItemResolverFactoryPersistenceManagers
                    .get(child.getFactoryId()).restore(child);

            configuration.setCurrentResolver(slot, resolver);
        }
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.