Refine search
/** * Clear the info about which rows (in which original iterators and which row nums within them) were combined on * the previous step. */ private void clearCombinedRowsInfo() { for (int originalIteratorIndex = indexesOfCurrentlyCombinedOriginalIterators.nextSetBit(0); originalIteratorIndex >= 0; originalIteratorIndex = indexesOfCurrentlyCombinedOriginalIterators.nextSetBit(originalIteratorIndex + 1)) { minCurrentlyCombinedRowNumByOriginalIteratorIndex[originalIteratorIndex] = MIN_CURRENTLY_COMBINED_ROW_NUM_UNSET_VALUE; } indexesOfCurrentlyCombinedOriginalIterators.clear(); }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, appendOutput_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetEvent()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetEvent()) { struct.event.write(oprot); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, getAllResources_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.success = new ArrayList<String>(_list29.size); String _elem30; for (int _i31 = 0; _i31 < _list29.size; ++_i31) { _elem30 = iprot.readString(); struct.success.add(_elem30); } } struct.setSuccessIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, EnvironmentContext struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map324 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.properties = new HashMap<String,String>(2*_map324.size); String _key325; String _val326; for (int _i327 = 0; _i327 < _map324.size; ++_i327) { _key325 = iprot.readString(); _val326 = iprot.readString(); struct.properties.put(_key325, _val326); } } struct.setPropertiesIsSet(true); } } }
/** helper for gap encoding. */ private static byte[] bitSetToByteArray(BitSet bitSet) { while (bitSet.length() % 8 != 0) { bitSet.set(bitSet.length(), true); } byte[] array = new byte[bitSet.length()/8]; for (int i = 0; i < array.length; i++) { int offset = i * 8; int index = 0; for (int j = 0; j < 8; j++) { index <<= 1; if (bitSet.get(offset+j)) { index++; } } array[i] = (byte)(index - 128); } return array; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, getStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } }
if (s.getIDom() != block) { if (domFrontier == null) { domFrontier = new BitSet(blocks.size()); domFrontier.set(s.getId()); for (int p = frontier.nextSetBit(0); p >= 0; p = frontier.nextSetBit(p + 1)) { if (blocks.get(p).getIDom() != block) { if (domFrontier == null) { domFrontier = new BitSet(blocks.size()); domFrontier.set(p); if (domFrontier == null || domFrontier.cardinality() == 0) { domFrontier = EMPTY;
private void doParse(String[] fields) { setNumberHits(this.seconds, fields[0], 0, 60); setNumberHits(this.minutes, fields[1], 0, 60); setNumberHits(this.hours, fields[2], 0, 24); setDaysOfMonth(this.daysOfMonth, fields[3]); setMonths(this.months, fields[4]); setDays(this.daysOfWeek, replaceOrdinals(fields[5], "SUN,MON,TUE,WED,THU,FRI,SAT"), 8); if (this.daysOfWeek.get(7)) { // Sunday can be represented as 0 or 7 this.daysOfWeek.set(0); this.daysOfWeek.clear(7); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, resourceGet_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeBinary(struct.success); } }
public static BlockNode getPathCross(MethodNode mth, BlockNode b1, BlockNode b2) { if (b1 == null || b2 == null) { return null; } BitSet b = new BitSet(); b.or(b1.getDomFrontier()); b.and(b2.getDomFrontier()); b.clear(b1.getId()); b.clear(b2.getId()); if (b.cardinality() == 1) { BlockNode end = mth.getBasicBlocks().get(b.nextSetBit(0)); if (isPathExists(b1, end) && isPathExists(b2, end)) { return end; } } if (isPathExists(b1, b2)) { return b2; } if (isPathExists(b2, b1)) { return b1; } return null; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, getProgress_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } }
@Override public boolean matches(char c) { return table.get(c); }
static CharMatcher from(BitSet chars, String description) { // Compute the filter. long filter = 0; int size = chars.cardinality(); boolean containsZero = chars.get(0); // Compute the hash table. char[] table = new char[chooseTableSize(size)]; int mask = table.length - 1; for (int c = chars.nextSetBit(0); c != -1; c = chars.nextSetBit(c + 1)) { // Compute the filter at the same time. filter |= 1L << c; int index = smear(c) & mask; while (true) { // Check for empty. if (table[index] == 0) { table[index] = (char) c; break; } // Linear probing. index = (index + 1) & mask; } } return new SmallCharMatcher(table, filter, containsZero, description); }