Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hudi.common.model;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import org.apache.avro.Schema;
import org.apache.hudi.common.util.Option;
import org.apache.hudi.common.util.collection.Pair;
import org.apache.hudi.keygen.BaseKeyGenerator;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
public class HoodieEmptyRecord extends HoodieRecord {
private HoodieRecordType type;
private Comparable orderingVal;
public HoodieEmptyRecord(HoodieKey key, HoodieRecordType type) {
super(key, null);
this.type = type;
this.orderingVal = null;
}
public HoodieEmptyRecord(HoodieKey key, HoodieOperation operation, Comparable orderingVal, HoodieRecordType type) {
super(key, null, operation, Option.empty());
this.type = type;
this.orderingVal = orderingVal;
}
@Override
public T getData() {
return null;
}
@Override
public Comparable getOrderingValue(Schema recordSchema, Properties props) {
return orderingVal;
}
@Override
public HoodieRecord newInstance() {
return this;
}
@Override
public HoodieRecord newInstance(HoodieKey key, HoodieOperation op) {
return new HoodieEmptyRecord<>(key, op, orderingVal, type);
}
@Override
public HoodieRecord newInstance(HoodieKey key) {
return new HoodieEmptyRecord<>(key, type);
}
@Override
public HoodieRecordType getRecordType() {
return type;
}
@Override
public String getRecordKey(Schema recordSchema,
Option keyGeneratorOpt) {
return key.getRecordKey();
}
@Override
public String getRecordKey(Schema recordSchema, String keyFieldName) {
return key.getRecordKey();
}
@Override
public Object[] getColumnValues(Schema recordSchema, String[] columns, boolean consistentLogicalTimestampEnabled) {
throw new UnsupportedOperationException();
}
@Override
public HoodieRecord joinWith(HoodieRecord other, Schema targetSchema) {
throw new UnsupportedOperationException();
}
@Override
public HoodieRecord prependMetaFields(Schema recordSchema, Schema targetSchema, MetadataValues metadataValues, Properties props) {
throw new UnsupportedOperationException();
}
@Override
public HoodieRecord rewriteRecordWithNewSchema(Schema recordSchema, Properties props, Schema newSchema, Map renameCols) {
throw new UnsupportedOperationException();
}
@Override
public HoodieRecord truncateRecordKey(Schema recordSchema, Properties props, String keyFieldName) {
throw new UnsupportedOperationException();
}
@Override
public boolean isDelete(Schema recordSchema, Properties props) throws IOException {
return true;
}
@Override
public boolean shouldIgnore(Schema recordSchema, Properties props) throws IOException {
return false;
}
@Override
public HoodieRecord copy() {
return this;
}
@Override
public HoodieRecord wrapIntoHoodieRecordPayloadWithParams(Schema recordSchema, Properties props, Option> simpleKeyGenFieldsOpt,
Boolean withOperation, Option partitionNameOp, Boolean populateMetaFieldsOp) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public HoodieRecord wrapIntoHoodieRecordPayloadWithKeyGen(Schema recordSchema,
Properties props, Option keyGen) {
throw new UnsupportedOperationException();
}
@Override
public Option toIndexedRecord(Schema recordSchema, Properties props) throws IOException {
return Option.empty();
}
@Override
public Option