Examples of createKey()


Examples of net.sf.joafip.kvstore.record.service.DataRecordKeyManager.createKey()

  public void testUseAsAMap() throws HeapException {
    final DataRecordKeyManager keyManager = DataRecordKeyManager
        .getInstance();
    createFileHeapDataManager(true);
    heapDataManager.setDataRecordKeyManager(keyManager);
    final DataRecordIdentifier keyA = keyManager.createKey("A");
    assertFalse("must not found 'A'", heapDataManager.hasDataRecord(keyA));
    final byte[] dataA = "valueA".getBytes();
    heapDataManager.writeDataRecord(keyA, dataA);
    assertTrue("must found 'A'", heapDataManager.hasDataRecord(keyA));
    final byte[] readDataA = heapDataManager.readDataRecord(keyA);
View Full Code Here

Examples of org.apache.deltacloud.client.DeltaCloudClient.createKey()

  @Test
  public void canCreateKey() throws DeltaCloudClientException {
    String id = "test" + System.currentTimeMillis();
    DeltaCloudClient client = testSetup.getClient();
    try {
      Key key = client.createKey(id);
      assertNotNull(key);
      assertEquals(id, key.getId());
    } finally {
      quietlyDeleteKey(id);
    }
View Full Code Here

Examples of org.apache.hadoop.mapred.RecordReader.createKey()

    assertEquals("splits length should be " + splitNumber, splits.length, splitNumber);
    int readCount = 0;
    for (int i = 0; i < splits.length; i++) {
      int previousReadCount = readCount;
      RecordReader rr = inputFormat.getRecordReader(splits[i], jonconf, Reporter.NULL);
      Object key = rr.createKey();
      Object value = rr.createValue();
      while (rr.next(key, value)) {
        readCount++;
      }
      System.out.println("The " + i + "th split read "
View Full Code Here

Examples of org.apache.hadoop.mapred.RecordReader.createKey()

    assertEquals("splits length should be " + splitNumber, splits.length, splitNumber);
    int readCount = 0;
    for (int i = 0; i < splits.length; i++) {
      int previousReadCount = readCount;
      RecordReader rr = inputFormat.getRecordReader(splits[i], jonconf, Reporter.NULL);
      Object key = rr.createKey();
      Object value = rr.createValue();
      while (rr.next(key, value)) {
        readCount++;
      }
      System.out.println("The " + i + "th split read "
View Full Code Here

Examples of org.apache.hadoop.mapred.lib.db.DBInputFormat.DBRecordReader.createKey()

    @SuppressWarnings("rawtypes")
    DBRecordReader reader = new DBInputFormat<NullDBWritable>().new DBRecordReader(
        new DBInputSplit(),  NullDBWritable.class, job,
        DriverForTest.getConnection(), dbConfig, "condition", fields, "table");
    LongWritable key = reader.createKey();
    assertEquals(0, key.get());
    DBWritable value = reader.createValue();
    assertEquals(
        "org.apache.hadoop.mapred.lib.db.DBInputFormat$NullDBWritable", value
            .getClass().getName());
View Full Code Here

Examples of org.apache.mahout.df.mapred.inmem.InMemInputFormat.InMemRecordReader.createKey()

        InMemInputSplit split = (InMemInputSplit) splits[index];
        InMemRecordReader reader = (InMemRecordReader) inputFormat.getRecordReader(
            split, conf, null);

        for (int tree = 0; tree < split.getNbTrees(); tree++) {
          IntWritable key = reader.createKey();
          NullWritable value = reader.createValue();

          // reader.next() should return true until there is no tree left
          assertEquals(tree < split.getNbTrees(), reader.next(key, value));
         
View Full Code Here

Examples of org.apache.ws.sandbox.security.conversation.dkalgo.DerivationAlgorithm.createKey()

        String labelAndNonce = getLabelAndNonce(convSession, dkInfo); //Label and nonce
        long keyLength = getKeyLength(convSession, dkInfo); //Length of the key to generated
        int offset = getOffset(convSession, dkInfo);
        DerivationAlgorithm derivationAlgo = AlgoFactory.getInstance(dkInfo.
                getAlgorithm()); //Derivation algorithm
        return derivationAlgo.createKey(secret, labelAndNonce, offset, keyLength);
    }

    /**
     * The label+nonce value used for the seed in calculating the derived key
     *
 
View Full Code Here

Examples of org.apache.ws.security.conversation.dkalgo.DerivationAlgorithm.createKey()

           
            byte[] seed = new byte[labelBytes.length + nonce.length];
            System.arraycopy(labelBytes, 0, seed, 0, labelBytes.length);
            System.arraycopy(nonce, 0, seed, labelBytes.length, nonce.length);
           
            this.keyBytes = algo.createKey(this.secret, seed, offset, length);
           
        } catch (Exception e) {
            throw new WSSecurityException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.apache.ws.security.conversation.dkalgo.DerivationAlgorithm.createKey()

        System.arraycopy(label, 0, seed, 0, label.length);
        System.arraycopy(nonce, 0, seed, label.length, nonce.length);
       
        DerivationAlgorithm algo = AlgoFactory.getInstance(ConversationConstants.DerivationAlgorithm.P_SHA_1);
       
        this.derivedKeyBytes = algo.createKey(this.ephemeralKey, seed, offset, length);
       
       
        //Add the DKTs
        dkt = new DerivedKeyToken(document);
        dktId = "derivedKeyId-" + dkt.hashCode();
View Full Code Here

Examples of org.apache.ws.security.conversation.dkalgo.DerivationAlgorithm.createKey()

        System.arraycopy(label, 0, seed, 0, label.length);
        System.arraycopy(nonce, 0, seed, label.length, nonce.length);
       
        DerivationAlgorithm algo = AlgoFactory.getInstance(ConversationConstants.DerivationAlgorithm.P_SHA_1);
       
        this.derivedKeyBytes = algo.createKey(this.ephemeralKey, seed, offset, length);
       
       
        //Add the DKTs
        dkt = new DerivedKeyToken(this.wscVersion, document);
        dktId = "derivedKeyId-" + dkt.hashCode();
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.