Examples of toBytes()


Examples of io.airlift.units.DataSize.toBytes()

        // add pages up to the size limit
        List<Page> responsePages = new ArrayList<>();
        responsePages.add(page);
        long responseSize = page.getSizeInBytes();
        while (responseSize < maxSize.toBytes()) {
            page = pages.poll();
            if (page == null) {
                break;
            }
            responsePages.add(page);
View Full Code Here

Examples of io.dropwizard.util.Size.toBytes()

                        Duration dropWizardDuration = Duration.parse(fieldValue.asText());
                        long asLong = time.value().convert(dropWizardDuration.getQuantity(), dropWizardDuration.getUnit());
                        fieldValues.put(propertyName, asLong);
                    } else if (prop.getAnnotation(Bytes.class) != null) {
                        Size dropWizardSize = Size.parse(fieldValue.asText());
                        long asLong = dropWizardSize.toBytes();
                        fieldValues.put(propertyName, asLong);
                    }
                } catch (Throwable cause) {
                    throw JsonMappingException.wrapWithPath(cause, prop.getType().getRawClass(), propertyName);
                }
View Full Code Here

Examples of net.agkn.hll.HLL.toBytes()

                            hll.addRaw(item);
                        }
                        HLL copy = HLL.fromBytes(hll.toBytes());
                        assertEquals(copy.cardinality(), hll.cardinality());
                        assertEquals(copy.getType(), hll.getType());
                        assertEquals(copy.toBytes(), hll.toBytes());

                        HLL clone = hll.clone();
                        assertEquals(clone.cardinality(), hll.cardinality());
                        assertEquals(clone.getType(), hll.getType());
                        assertEquals(clone.toBytes(), hll.toBytes());
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress.toBytes()

            for (Integer i : device.getIPv4Addresses()) {
                if (gatewayToGuid.containsKey(i)) {
                    MACAddress mac = MACAddress.valueOf(device.getMACAddress());
                    if (log.isDebugEnabled())
                        log.debug("Adding MAC {} with IP {} a a gateway",
                                    HexString.toHexString(mac.toBytes()),
                                    IPv4.fromIPv4Address(i));
                        macToGateway.put(mac, i);
                    }
                }
            }
View Full Code Here

Examples of net.tomp2p.storage.Data.toBytes()

                    retVal.put(entry.getKey(), new Data().flag1());
                    LOG.debug("no sync required");
                } else {
                    // get the checksums
                  // TODO: don't copy data, toBytes does a copy!
                    List<Checksum> checksums = RSync.checksums(data.toBytes(), blockSize);
                    AlternativeCompositeByteBuf abuf = AlternativeCompositeByteBuf.compBuffer();
                    DataBuffer dataBuffer = SyncUtils.encodeChecksum(checksums, entry.getKey().versionKey(), data.hash(), abuf);
                    retVal.put(entry.getKey(), new Data(dataBuffer));
                    LOG.debug("sync required hash = {}", data.hash());
                }
View Full Code Here

Examples of oracle.sql.TIMESTAMPLTZ.toBytes()

        //However the java object is not know here.  The solution is to store Timestamp and the
        //session timezone in a wrapper class, which will be used later in converObject().
        TIMESTAMPLTZ tsLTZ = (TIMESTAMPLTZ)resultSet.getObject(columnNumber);
        if ((tsLTZ != null) && (tsLTZ.getLength() != 0)) {
            Connection connection = getConnection(session, resultSet.getStatement().getConnection());
            Timestamp timestampToWrap = TIMESTAMPLTZ.toTimestamp(connection, tsLTZ.toBytes());
            String sessionTimeZone = ((OracleConnection)connection).getSessionTimeZone();
            //Bug#4364359  Add a separate wrapper for TIMESTAMPLTZ. 
            return new TIMESTAMPLTZWrapper(timestampToWrap, sessionTimeZone, isLtzTimestampInGmt(connection));
        }
        return null;
View Full Code Here

Examples of oracle.sql.TIMESTAMPTZ.toBytes()

        if ((tsTZ != null) && (tsTZ.getLength() != 0)) {
            Connection connection = getConnection(session, resultSet.getStatement().getConnection());
            //Bug#4364359  Add a wrapper to overcome TIMESTAMPTZ not serializable as of jdbc 9.2.0.5 and 10.1.0.2. 
            //It has been fixed in the next version for both streams
            Timestamp timestampToWrap = tsTZ.timestampValue(connection);
            TimeZone timezoneToWrap = TIMESTAMPHelper.extractTimeZone(tsTZ.toBytes());
            return new TIMESTAMPTZWrapper(timestampToWrap, timezoneToWrap, isTimestampInGmt(connection));
        }
        return null;
    }
   
View Full Code Here

Examples of org.apache.hadoop.hbase.TableName.toBytes()

                Cell cell = cells.current();
                ByteBuffer rowKey = ByteBuffer.wrap(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
                byte[] payload;
                KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
                if (payloadExtractor != null && (payload = payloadExtractor.extractPayload(tableName.toBytes(), kv)) != null) {
                    if (payloadPerRowKey.containsKey(rowKey)) {
                        log.error("Multiple payloads encountered for row " + Bytes.toStringBinary(rowKey)
                                + ", choosing " + Bytes.toStringBinary(payloadPerRowKey.get(rowKey)));
                    } else {
                        payloadPerRowKey.put(rowKey, payload);
View Full Code Here

Examples of org.apache.phoenix.expression.aggregator.Aggregators.toBytes()

        }

        final boolean hadAny = hasAny;
        KeyValue keyValue = null;
        if (hadAny) {
            byte[] value = aggregators.toBytes(rowAggregators);
            keyValue = KeyValueUtil.newKeyValue(UNGROUPED_AGG_ROW_KEY, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, value, 0, value.length);
        }
        final KeyValue aggKeyValue = keyValue;
       
        RegionScanner scanner = new BaseRegionScanner() {
View Full Code Here

Examples of org.apache.phoenix.schema.PDataType.toBytes()

                }
                type = pkColumns.get(i).getDataType();
               
                //for fixed width data types like CHAR and BINARY, we need to pad values to be of max length.
                Object paddedObj = type.pad(values[i - offset], pkColumns.get(i).getMaxLength());
                byte[] value = type.toBytes(paddedObj);
                output.write(value);
            }
            return output.toByteArray();
        } finally {
            try {
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.