Clean the buffer of fields that will change a field that has been modified by the client.
@param buffer The Vector buffer to clean.
@param record The target Record.
545859
public void cleanBuffer(BaseBuffer buffer, Record record)
    {
        Vector<Object> vector = (Vector)buffer.getPhysicalData();
        int iCurrentIndex = 0;
        buffer.resetPosition(); // Start at the first field
        int iFieldCount = record.getFieldCount();   // Number of fields to read in
        for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq <= iFieldCount + Constants.MAIN_FIELD - 1; iFieldSeq++)
        {
            BaseField field = record.getField(iFieldSeq);
            if (!buffer.skipField(field))
            {
                if (field.isModified())
                    vector.set(iCurrentIndex, BaseBuffer.DATA_SKIP);    // If target modified don't move data
        //?        else if (record.getEditMode() == DBConstants.EDIT_ADD)
        //            if (field.getDefault() == vector.get(iCurrentIndex))
        //                vector.set(iCurrentIndex, BaseBuffer.DATA_SKIP); // On Add if data is the default, don't set.
                iCurrentIndex++;
            }
        }
    }
114797
@Override
	public void log(LogRecord record) {
		record.setMessage(maskPassword(record.getMessage()));
		super.log(record);
	}
1016483
protected void remove(MetricsRecordImpl record) {
    String recordName = record.getRecordName();
    TagMap tagTable = record.getTagTable();
        
    RecordMap recordMap = getRecordMap(recordName);
    synchronized (recordMap) {
      Iterator<TagMap> it = recordMap.keySet().iterator();
      while (it.hasNext()) {
        TagMap rowTags = it.next();
        if (rowTags.containsAll(tagTable)) {
          it.remove();
        }
      }
    }
  }
295425
public void removeCacheField()
    {
        try {
            Record record = this.getOwner();
            Object objKey = record.getHandle(DBConstants.OBJECT_ID_HANDLE);
            m_hsCache.remove(objKey);
        } catch (DBException ex)    {
            ex.printStackTrace();
        }
    }
1174102
public void init(Record record, BaseField fldDeleteFlag)
    {
        m_fldDeleteFlag = fldDeleteFlag;
        m_bFilterThisRecord = true;
        super.init(record);
    }
1373458
public void publish(LogRecord record)
  {
    if (! isLoggable(record))
      return;
    
    int level = getLevel().intValue();

    for (int i = 0; i < _handlers.length; i++) {
      Handler handler = _handlers[i];

      if (level <= handler.getLevel().intValue())
        handler.publish(record);
    }
  }
490391
public void processRecordInternally(Record record) {
        if (record instanceof FormatRecord) {
            FormatRecord fr = (FormatRecord) record;
            _customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr);
        }
        if (record instanceof ExtendedFormatRecord) {
            ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
            _xfRecords.add(xr);
        }
    }
777577
public void log(LogRecord record) {
        if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
            return;
        }
        Filter theFilter = filter;
        if (theFilter != null && !theFilter.isLoggable(record)) {
            return;
        }

        // Post the LogRecord to all our Handlers, and then to
        // our parents' handlers, all the way up the tree.

        Logger logger = this;
        while (logger != null) {
            for (Handler handler : logger.getHandlers()) {
                handler.publish(record);
            }

            if (!logger.getUseParentHandlers()) {
                break;
            }

            logger = logger.getParent();
        }
    }
310319
private void deleteHoleRecords() {
    listener.onMessage("\nDelete temporary records...");

    final ORecordId rid = new ORecordId();
    final ODocument doc = new ODocument(rid);
    for (String recId : recordToDelete) {
      doc.reset();
      rid.fromString(recId);
      doc.delete();
    }
    listener.onMessage("OK (" + recordToDelete.size() + " records)");
  }
1149363
public void fieldsToData(Rec record) throws DBException
    {
        BaseBuffer buffer = this.getNewDataBuffer();
        this.doSetHandle(buffer, DBConstants.DATA_SOURCE_HANDLE); // This way you can retrieve the current buffer.
        super.fieldsToData(record);
        buffer.finishBuffer();
    }
1223999
static public void dispose (ByteBuffer buffer) {
		if (!(buffer instanceof DirectBuffer)) return;
		if (cleanerMethod != null) {
			try {
				cleanMethod.invoke(cleanerMethod.invoke(buffer));
			} catch (Throwable ignored) {
			}
		}
	}
1059393
protected void removeLastFieldSeparator(final StringBuffer buffer) {
        final int len = buffer.length();
        final int sepLen = fieldSeparator.length();
        if (len > 0 && sepLen > 0 && len >= sepLen) {
            boolean match = true;
            for (int i = 0; i < sepLen; i++) {
                if (buffer.charAt(len - 1 - i) != fieldSeparator.charAt(sepLen - 1 - i)) {
                    match = false;
                    break;
                }
            }
            if (match) {
                buffer.setLength(len - sepLen);
            }
        }
    }
983694
public void clean()
	{

		ChronoFullRevision cfr = firstCFR;
		totalSize = size;
		while (cfr != null) {
			totalSize += cfr.size();
			cfr = cfr.getNext();
		}

		if (totalSize < MAX_STORAGE_SIZE) {
			return;
		}

		cfr = firstCFR;
		while (cfr != null) {
			totalSize += cfr.clean(revisionIndex, 0);
			cfr = cfr.getNext();
		}

		ChronoStorageBlock block;
		while (last != null && totalSize >= MAX_STORAGE_SIZE) {

			// System.out.println("CLEAN " + last.getRevisionIndex());

			// Retrieve previous block
			block = last.getIndexPrev();

			// Subtract size
			if (storage.remove(last.getRevisionIndex()) == null) {
				throw new RuntimeException("VALUE WAS NOT REMOVED FROM STORAGE");
			}
			totalSize -= last.length();
			size += last.length();

			// Delete references
			if (block != null) {
				block.setIndexNext(null);
			}
			last.setIndexPrev(null);

			cfr = last.getChronoFullRevision();
			totalSize += cfr.size()
					- cfr.clean(revisionIndex, last.getRevisionIndex());

			if (last == first) {
				first = null;
			}

			// Set the new last
			last = block;
		}

		
	}
219541
public void doSet(Rec record) throws DBException
    {
        super.doSet(record);
        if (m_arrayCache != null)
            if (m_iLogicalIndex != NO_INDEX)
            {
                m_arrayCache.set(m_iLogicalIndex, this.getDataSource());    // Show the current record as deleted.
            }
    }
1195644
private void readRecord(byte[] buffer, Table table)
   {
      //System.out.println(ByteArrayHelper.hexdump(buffer, true, 16, ""));
      int deletedFlag = getShort(buffer, 0);
      if (deletedFlag != 0)
      {
         Map<String, Object> row = new HashMap<String, Object>();
         for (ColumnDefinition column : m_definition.getColumns())
         {
            Object value = column.read(0, buffer);
            //System.out.println(column.getName() + ": " + value);
            row.put(column.getName(), value);
         }

         table.addRow(m_definition.getPrimaryKeyColumnName(), row);
      }
   }
275069
public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record)
    {
        if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName())))
        {
            field = null;
            if (record != null)
                field = record.getField(fieldInfo.getFieldName());
        }
        if (field != null)
        {
            if (field.getDataClass() == fieldInfo.getDataClass())
                fieldInfo.setData(field.getData());
            else
                fieldInfo.setString(field.toString());
        }
    }
393227
private void flushBuffer(final ByteBuffer buffer, final DataOutput stream) throws IOException {
        buffer.flip();
        stream.write(buffer.array(), buffer.arrayOffset(), buffer.remaining());

        buffer.clear();
    }