示例#1
0
    /**
     * Extract the city key from a supplier key/value pair. The city key is stored in the supplier
     * value, so the supplier key is not used.
     */
    public boolean createSecondaryKey(
        TupleInput primaryKeyInput, Object valueInput, TupleOutput indexKeyOutput) {

      SupplierData supplierData = (SupplierData) valueInput;
      String city = supplierData.getCity();
      if (city != null) {
        indexKeyOutput.writeString(supplierData.getCity());
        return true;
      } else {
        return false;
      }
    }
    /**
     * Extract the city key from a supplier key/value pair. The city key is stored in the supplier
     * value, so the supplier key is not used.
     */
    public Object createSecondaryKey(Object primaryKeyInput, Object valueInput) {

      SupplierData supplierData = (SupplierData) valueInput;
      return supplierData.getCity();
    }