Examples of Tuple2


Examples of de.iritgo.simplelife.data.Tuple2

    if (principal == null)
    {
      return false;
    }

    Acl acl = aclByDomainObject.get(new Tuple2(objectType, objectId));
    if (acl != null && acl.checkPermission(principal, new SimplePermission(permission)))
    {
      return true;
    }
View Full Code Here

Examples of de.iritgo.simplelife.data.Tuple2

    if (principal == null)
    {
      return false;
    }

    Acl acl = aclByDomainObject.get(new Tuple2(AkteraUser.class.getName(), userId));
    if (acl != null && acl.checkPermission(principal, new SimplePermission(permission)))
    {
      return true;
    }

    for (Integer groupId : userDAO.listGroupIdsOfUserId(userId.intValue()))
    {
      acl = aclByDomainObject.get(new Tuple2(AkteraGroup.class.getName(), groupId));
      if (acl != null && acl.checkPermission(principal, new SimplePermission(permission)))
      {
        return true;
      }
    }
View Full Code Here

Examples of de.iritgo.simplelife.data.Tuple2

          group = new Group(groupName);
          groups.put(groupName, group);

          for (Permission permissionEntity : permissionDAO.findGroupPermissions(akteraGroup))
          {
            Tuple2 aclKey = new Tuple2(permissionEntity.getObjectType() != null ? permissionEntity
                    .getObjectType() : GLOBAL_OBJECT_TYPE, permissionEntity.getObjectId());
            Acl acl = aclByDomainObject.get(aclKey);
            if (acl == null)
            {
              acl = new Acl(ROOT, ROOT_NAME);
              aclByDomainObject.put(aclKey, acl);
            }
            AclEntry aclEntry = acl.findAclEntry(group, permissionEntity.getNegative());
            if (aclEntry == null)
            {
              aclEntry = new AclEntry(group);
              if (permissionEntity.getNegative())
              {
                aclEntry.setNegativePermissions();
              }
              acl.addEntry(ROOT, aclEntry);
            }
            aclEntry.addPermission(new SimplePermission(permissionEntity.getPermission()));
          }
        }

        if (! group.isMember(principal))
        {
          group.addMember(principal);
        }
      }

      for (Permission permissionEntity : permissionDAO.findUserPermissions(akteraUser))
      {
        Tuple2 aclKey = new Tuple2(permissionEntity.getObjectType() != null ? permissionEntity.getObjectType()
                : GLOBAL_OBJECT_TYPE, permissionEntity.getObjectId());
        Acl acl = aclByDomainObject.get(aclKey);
        if (acl == null)
        {
          acl = new Acl(ROOT, ROOT_NAME);
View Full Code Here

Examples of eu.stratosphere.api.java.tuple.Tuple2

        .setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("select * from books")
        .finish();
    jdbcInputFormat.open(null);
    jdbcInputFormat.nextRecord(new Tuple2());
  }
View Full Code Here

Examples of org.apache.flink.api.java.tuple.Tuple2

        .setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("select * from books")
        .finish();
    jdbcInputFormat.open(null);
    jdbcInputFormat.nextRecord(new Tuple2());
  }
View Full Code Here

Examples of scala.Tuple2

  public static Map<String, Model> toScalaModelMap(java.util.Map<String, Model> map) {
    if (null != map) {
      final Tuple2[] ts = new Tuple2[map.size()];
      int i = 0;
      for (java.util.Map.Entry<String, Model> entry : map.entrySet()) {
        ts[i] = new Tuple2(entry.getKey(), entry.getValue());
        i++;
      }
      final WrappedArray wa = Predef.wrapRefArray(ts);
      return (Map<String, Model>) Predef$.MODULE$.Map().apply(wa);
    }
View Full Code Here

Examples of scala.Tuple2

   private T createTuple(Object[] data)
   {
      switch(subreaders.length)
      {
         case 2:
            return (T)new Tuple2(data[0], data[1]);
         case 3:
            return (T)new Tuple3(data[0], data[1], data[2]);
         case 4:
            return (T)new Tuple4(data[0], data[1], data[2], data[3]);
         case 5:
View Full Code Here

Examples of scala.Tuple2

                  <= FIVE_MIN_MILLIS) {
                correlated.add(click);
              }
            }
            if (!correlated.isEmpty()) {
              results.add(new Tuple2(CorrelatedEvents.newBuilder()
                  .setEvent(alert)
                  .setCorrelated(correlated)
                  .build(), null));
            }
          }
View Full Code Here

Examples of scala.Tuple2

    JavaPairRDD<String, Float> readings = jsc.textFile("../data/helloworld/data.csv")
      .mapToPair(new PairFunction<String, String, Float>() {
        @Override
        public Tuple2 call(String line) {
          String[] tokens = line.split("[\t,]");
          Tuple2 reading = null;
          try {
            reading = new Tuple2(
              tokens[0],
              Float.parseFloat(tokens[1]));
          } catch (Exception e) {
            logger.error("Can't parse reading file. Caught Exception: " + e.getMessage());
            System.exit(1);
View Full Code Here

Examples of scala.Tuple2

      JavaPairRDD<Object, Query> indexedQueries) {
    return model.temperatures.join(indexedQueries.mapToPair(
        new PairFunction<Tuple2<Object, Query>, String, Object>() {
          @Override   // reverse the query tuples, then join
          public Tuple2 call(Tuple2<Object, Query> tuple) {
            return new Tuple2(tuple._2.day, tuple._1);
          }
        })).mapToPair(
        new PairFunction<Tuple2<String, Tuple2<Float, Object>>, Object, Float>() {
          @Override   // map result back to predictions, dropping the day
          public Tuple2 call(Tuple2<String, Tuple2<Float, Object>> tuple) {
            return new Tuple2(tuple._2._2, tuple._2._1);
          }
        });
  }
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.