Set the record that this field references.
@param record The record to set as the record reference.
430355
public void setReferenceRecord(Record record)
    {
        if (m_recordReference != record)
        {
            if (m_recordReference != null)
            { // Take behaviors off old references
               // You only want to disconnect the referenced record (not free it).
                if (this.getRecord() != null)
                {
                    FreeOnFreeHandler freeListener = (FreeOnFreeHandler)this.getRecord().getListener(FreeOnFreeHandler.class);
                    while (freeListener != null)
                    {
                        if (freeListener.getDependentObject() == m_recordReference)
                        {
                            freeListener.setDependentObject(null);
                            this.getRecord().removeListener(freeListener, true);
                            break;
                        }
                        freeListener = (FreeOnFreeHandler)freeListener.getListener(FreeOnFreeHandler.class);
                    }
                }

                ClearFieldReferenceOnCloseHandler listener = (ClearFieldReferenceOnCloseHandler)m_recordReference.getListener(ClearFieldReferenceOnCloseHandler.class.getName());
                while (listener != null)
                {
                    if (listener.getField() == this)
                    {
                        Record recordTemp = m_recordReference;
                        m_recordReference = null; // Cancel echo
                        recordTemp.removeListener(listener, true);
                        listener = null;    // Got it!
                    }
                    else
                        listener = (ClearFieldReferenceOnCloseHandler)listener.getListener(ClearFieldReferenceOnCloseHandler.class.getName());
                }
            }
            if (record != null)
            { // Make sure reference is cleared when record is discarded
                record.addListener(new ClearFieldReferenceOnCloseHandler(this));
            }
            m_recordReference = record;
        }
    }
1011506
public void fieldsToData(Rec record) throws DBException
    {
        this.setupNewDataSource();
        int fieldCount = record.getFieldCount(); // Number of fields to write out
        for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq < fieldCount + Constants.MAIN_FIELD; iFieldSeq++)
        {
            Field field = record.getField(iFieldSeq);
            if (field.isVirtual()) //x || (!field.isSelected()))
                continue;               // This field is never moved to a buffer
            this.fieldToData(field);
        }
    }
1118359
public void storeRecord(RepositoryLogRecord record) {
		if (isClosed) {
			throw new IllegalStateException("This instance of the exporter is already closed");
		}
		if (!isInitialized) {
			throw new IllegalStateException("This instance of the exporter does not have header information yet");
		}
		String formatRecord = formatter.formatRecord(record);
		out.print(formatRecord);
		out.print(formatter.getLineSeparator());
	}
128095
private void set(String fieldName, Object value) {
    try {
      String subField;
      Iterator<String> levels = Splitter.on(".").split(fieldName).iterator();
      GenericRecord toInsert = record;
      subField = levels.next();
      Object subRecord = toInsert;

      while (levels.hasNext()) {
        if (subRecord instanceof GenericRecord) {
          subRecord = ((GenericRecord)subRecord).get(subField);
        } else if (subRecord instanceof List) {
          subRecord = ((List)subRecord).get(Integer.parseInt(subField));
        } else if (subRecord instanceof Map) {
          subRecord = ((Map)subRecord).get(subField);
        }

        if (subRecord == null) {
          throw new FieldDoesNotExistException("Field " + subField + " not found when trying to set " + fieldName);
        }
        subField = levels.next();
      }

      if (!(subRecord instanceof GenericRecord)) {
        throw new IllegalArgumentException("Field " + fieldName + " does not refer to a record type.");
      }

      toInsert = (GenericRecord)subRecord;
      Object oldValue = toInsert.get(subField);

      toInsert.put(subField, value);

      Schema.Field changedField = toInsert.getSchema().getField(subField);
      GenericData genericData = GenericData.get();

      boolean valid = genericData
          .validate(changedField.schema(), genericData.getField(toInsert, changedField.name(), changedField.pos()));
      if (!valid) {
        toInsert.put(subField, oldValue);
        throw new IncorrectTypeException(
            "Incorrect type - can't insert a " + value.getClass().getCanonicalName() + " into an Avro record of type "
                + changedField.schema().getType().toString());
      }
    } catch (AvroRuntimeException e) {
      throw new FieldDoesNotExistException("Field not found setting name " + fieldName, e);
    }
  }
1125423
protected void update(MetricsRecordImpl record) {
    String recordName = record.getRecordName();
    TagMap tagTable = record.getTagTable();
    Map<String,MetricValue> metricUpdates = record.getMetricTable();
        
    RecordMap recordMap = getRecordMap(recordName);
    synchronized (recordMap) {
      MetricMap metricMap = recordMap.get(tagTable);
      if (metricMap == null) {
        metricMap = new MetricMap();
        TagMap tagMap = new TagMap(tagTable); // clone tags
        recordMap.put(tagMap, metricMap);
      }

      Set<Entry<String, MetricValue>> entrySet = metricUpdates.entrySet();
      for (Entry<String, MetricValue> entry : entrySet) {
        String metricName = entry.getKey ();
        MetricValue updateValue = entry.getValue ();
        Number updateNumber = updateValue.getNumber();
        Number currentNumber = metricMap.get(metricName);
        if (currentNumber == null || updateValue.isAbsolute()) {
          metricMap.put(metricName, updateNumber);
        }
        else {
          Number newNumber = sum(updateNumber, currentNumber);
          metricMap.put(metricName, newNumber);
        }
      }
    }
  }
67589
@Override
  public synchronized void publish(LogRecord record)
  {
    if (!super.isLoggable(record) || this.getLevel() != null &&
                                     record.getLevel().intValue() < this.getLevel().intValue())
    {
      return;
    }

    synchronized (logBuffer)
    {
      if (logBuffer.size() == LOG_BUFFER_SIZE)
      {
        logBuffer.remove(0);
      }

      logBuffer.add(record);
    }
  }
766537
public void setRecordMetadata(String key, Object value) {
    if (_recordMetadata == null) {
      _recordMetadata = new HashMap<>();
    }

    _recordMetadata.put(key, value);
  }
397889
public void doSet(Record record) throws DBException
    {
        try   {
            BaseBuffer buffer = (BaseBuffer)m_dataSource;
            Object data = buffer.getPhysicalData();
            synchronized (this.getSyncObject())
            {   // In case this is called from another task
                m_tableRemote.set(data, this.getRecord().getOpenMode());
            }
        } catch (Exception ex) {
            throw DatabaseException.toDatabaseException(ex);
        }
    }
207511
public void initSharedRecord(Record record)
    {
        FieldListener listener = null;
        try {
            BaseField field = record.getSharedRecordTypeKey();
            field.addListener(listener = new InitOnceFieldHandler(null));
            field.setData(new Integer(0), true, DBConstants.INIT_MOVE);
            field.setData(new Integer(0), true, DBConstants.INIT_MOVE);
            if (field != null)
                if (field.getDataClass() == Integer.class)
            {
                for (int i = 1; ; i++)
                {
                    Integer intData = new Integer(i);
                    field.setData(intData);
                    record.addNew();
                    Record recShared = record.getTable().getCurrentTable().getRecord();
                    if (recShared == null)
                        break;
                    if (recShared == record)
                        break;
                    if (recShared.getField(field.getFieldName()).getValue() != i)
                        break;
                    this.disableAllListeners(recShared);
                }
            }
        } catch (DBException ex) {
            ex.printStackTrace();
        } finally {
            if (listener != null)
                record.removeListener(listener, true);
        }
    }
917266
public void index(Record record) {
    for (Property p : config.getIdentityProperties()) {
      Collection<String> values = record.getValues(p.getName());
      if (values == null)
        continue;
      
      for (String id : values)
        idindex.put(id, record);
    }
    records.add(record);
  }

  /**
   * Look up record by identity.
   */
  public Record findRecordById(String id) {
    return idindex.get(id);
  }

  /**
   * Look up potentially matching records.
   */
  public Collection<Record> findCandidateMatches(Record record) {
    return records;
  }

  /**
   * Flushes all changes to disk. For in-memory databases this is a
   * no-op.
   */
  public void commit() {
  }
  
  /**
   * Stores state to disk and closes all open resources.
   */
  public void close() {
  }

  public String toString() {
    return "InMemoryDatabase";
  }
}
1021604
public void write(WARCWritable record) throws IOException {
        if (record.getRecord() != null) write(record.getRecord());
    }
603436
public void init(BaseDatabase database, Record record)
    {
        m_pTable = null;
        super.init(database, record);
        m_pTable = ((PhysicalDatabase)database).getPDatabase().getPTable(record, true);
        m_pTable.addPTableOwner(this);
    }
672766
def set_record(self, name, record_id, record):
        
        if name not in self._cache:
            self._cache[name] = {}
        self._cache[name][record_id] = record
1007354
public void init(Record record, Record recordSub, boolean bRestoreCurrentRecord)
    {
        m_recordSub = recordSub;
        m_bRestoreCurrentRecord = bRestoreCurrentRecord;
        super.init(record);
    }
114797
@Override
	public void log(LogRecord record) {
		record.setMessage(maskPassword(record.getMessage()));
		super.log(record);
	}
857487
public static void setColumnsMap(Record record, Map<String, Object> columns) {
		record.setColumnsMap(columns);
	}
49803
private Record setDefault(Record record) {
        int size = record.size();
        for (int i = 0; i < size; i++)
            if (record.get(i) == null) {
                @SuppressWarnings("unchecked")
                Field<Object> field = (Field<Object>) record.field(i);
                if (!field.getDataType().nullable() && !field.getDataType().identity())
                    record.set(field, DSL.defaultValue());
            }
        return record;
    }