Search in sources :

Example 21 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project flink by apache.

the class TemporalTableSourceSpec method getTemporalTable.

@JsonIgnore
public RelOptTable getTemporalTable(FlinkContext flinkContext) {
    if (null != temporalTable) {
        return temporalTable;
    }
    if (null != tableSourceSpec && null != outputType) {
        LookupTableSource lookupTableSource = tableSourceSpec.getLookupTableSource(flinkContext);
        SourceAbilitySpec[] sourceAbilitySpecs = null;
        if (null != tableSourceSpec.getSourceAbilities()) {
            sourceAbilitySpecs = tableSourceSpec.getSourceAbilities().toArray(new SourceAbilitySpec[0]);
        }
        return new TableSourceTable(null, outputType, FlinkStatistic.UNKNOWN(), lookupTableSource, true, tableSourceSpec.getContextResolvedTable(), flinkContext, sourceAbilitySpecs);
    }
    throw new TableException("Can not obtain temporalTable correctly!");
}
Also used : TableException(org.apache.flink.table.api.TableException) SourceAbilitySpec(org.apache.flink.table.planner.plan.abilities.source.SourceAbilitySpec) LookupTableSource(org.apache.flink.table.connector.source.LookupTableSource) TableSourceTable(org.apache.flink.table.planner.plan.schema.TableSourceTable) JsonIgnore(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore)

Example 22 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project hbase by apache.

the class TableSchemaModel method getTableDescriptor.

/**
 * @return a table descriptor
 */
@JsonIgnore
public TableDescriptor getTableDescriptor() {
    TableDescriptorBuilder tableDescriptorBuilder = TableDescriptorBuilder.newBuilder(TableName.valueOf(getName()));
    for (Map.Entry<QName, Object> e : getAny().entrySet()) {
        tableDescriptorBuilder.setValue(e.getKey().getLocalPart(), e.getValue().toString());
    }
    for (ColumnSchemaModel column : getColumns()) {
        ColumnFamilyDescriptorBuilder cfdb = ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(column.getName()));
        for (Map.Entry<QName, Object> e : column.getAny().entrySet()) {
            cfdb.setValue(e.getKey().getLocalPart(), e.getValue().toString());
        }
        tableDescriptorBuilder.setColumnFamily(cfdb.build());
    }
    return tableDescriptorBuilder.build();
}
Also used : QName(javax.xml.namespace.QName) ColumnFamilyDescriptorBuilder(org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder) TableDescriptorBuilder(org.apache.hadoop.hbase.client.TableDescriptorBuilder) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 23 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project XRTB by benmfaul.

the class WinObject method getJson.

/**
 * The worker method for converting a WIN http target into a win
 * notification in the bidder.
 *
 * @param target
 *            String. The HTTP url that makes up the win notification from
 *            the exchange.
 * @return String. The ADM field to be used by exchange serving up the data.
 * @throws Exception
 *             on REDIS errors.
 */
@JsonIgnore
public static String getJson(String target) throws Exception {
    String image = null;
    String[] parts = target.split("http");
    String forward = "http:" + parts[1];
    if (parts.length > 2)
        image = "http:" + parts[2];
    parts = parts[1].split("/");
    String pubId = parts[5];
    String price = parts[6];
    String lat = parts[7];
    String lon = parts[8];
    String adId = parts[9];
    String cridId = parts[10];
    String hash = parts[11];
    hash = hash.replaceAll("%23", "#");
    if (image != null)
        image = decoder.decode(image, "UTF-8");
    forward = decoder.decode(forward, "UTF-8");
    String cost = "";
    /*
		 * This is synthetic, because in reality, adx has no win notification,
		 * this is a fake pixel fire that does the work
		 */
    if (pubId.equals(AdxBidRequest.ADX)) {
        Long value = AdxWinObject.decrypt(price, System.currentTimeMillis());
        Double dv = new Double(value);
        dv /= 1000000;
        price = dv.toString();
        convertBidToWin(hash, cost, lat, lon, adId, cridId, pubId, image, forward, dv.toString(), pubId);
        BidRequest.incrementWins(pubId);
        return "";
    }
    if (pubId.equals(OpenRTB.GOOGLE)) {
        Double dv = GoogleWinObject.decrypt(price, System.currentTimeMillis());
        dv /= 1000;
        price = dv.toString();
        convertBidToWin(hash, cost, lat, lon, adId, cridId, pubId, image, forward, dv.toString(), pubId);
        BidRequest.incrementWins(pubId);
        return "";
    }
    Map bid = null;
    try {
        bid = Controller.getInstance().getBidData(hash);
    } catch (Exception error) {
        AerospikeHandler.reset();
        return "";
    }
    // if (bid == null || bid.isEmpty()) {
    // throw new Exception("No bid to convert to win: " + hash);
    // }
    String adm = null;
    try {
        adm = (String) bid.get("ADM");
        cost = (String) bid.get("PRICE");
    } catch (Exception error) {
    // System.out.println("-----------> " + bid);
    }
    // the accounting works. just return ""
    try {
        convertBidToWin(hash, cost, lat, lon, adId, cridId, pubId, image, forward, price, adm);
    } catch (Exception error) {
        logger.error("Error: {}, target: {}", error.toString(), target);
    }
    BidRequest.incrementWins(pubId);
    if (adm == null) {
        return "";
    }
    return adm;
}
Also used : Map(java.util.Map) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 24 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project OpenRefine by OpenRefine.

the class ImportingJob method getSelectedFileRecords.

@JsonIgnore
public List<ObjectNode> getSelectedFileRecords() {
    List<ObjectNode> results = new ArrayList<ObjectNode>();
    ObjectNode retrievalRecord = JSONUtilities.getObject(config, "retrievalRecord");
    if (retrievalRecord != null) {
        ArrayNode fileRecordArray = JSONUtilities.getArray(retrievalRecord, "files");
        if (fileRecordArray != null) {
            ArrayNode fileSelectionArray = JSONUtilities.getArray(config, "fileSelection");
            if (fileSelectionArray != null) {
                for (int i = 0; i < fileSelectionArray.size(); i++) {
                    int index = JSONUtilities.getIntElement(fileSelectionArray, i, -1);
                    if (index >= 0 && index < fileRecordArray.size()) {
                        results.add(JSONUtilities.getObjectElement(fileRecordArray, index));
                    }
                }
            }
        }
    }
    return results;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayList(java.util.ArrayList) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 25 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project MantaroBot by Mantaro.

the class DBGuild method generateAndApplyPremiumKey.

@JsonIgnore
public PremiumKey generateAndApplyPremiumKey(int days) {
    String premiumId = UUID.randomUUID().toString();
    PremiumKey newKey = new PremiumKey(premiumId, TimeUnit.DAYS.toMillis(days), currentTimeMillis() + TimeUnit.DAYS.toMillis(days), PremiumKey.Type.GUILD, true, id, new PremiumKeyData());
    data.setPremiumKey(premiumId);
    newKey.saveAsync();
    saveAsync();
    return newKey;
}
Also used : PremiumKeyData(net.kodehawa.mantarobot.db.entities.helpers.PremiumKeyData) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)111 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)8 Map (java.util.Map)8 HashSet (java.util.HashSet)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 Date (java.util.Date)5 Field (com.hortonworks.registries.common.Schema.Field)4 Set (java.util.Set)4 Schema (com.hortonworks.registries.common.Schema)3 PrimaryKey (com.hortonworks.registries.storage.PrimaryKey)3 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 JsonArray (io.vertx.core.json.JsonArray)3 List (java.util.List)3 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)2 TrustAndKeyProvider (com.codingchili.core.security.TrustAndKeyProvider)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2