anton-vinogradov commented on code in PR #10393: URL: https://github.com/apache/ignite/pull/10393#discussion_r1100422070
########## modules/core/src/main/java/org/apache/ignite/spi/transform/CacheObjectTransformer.java: ########## @@ -0,0 +1,51 @@ +/* + * 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.ignite.spi.transform; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.lang.IgniteExperimental; + +/** + * Provides cache object's bytes transformation (eg. encryption, compression, etc). + */ +@IgniteExperimental +public interface CacheObjectTransformer { + /** Additional space required to store the transformed data. */ + public int OVERHEAD = 2; + + /** + * Transforms the data. + * + * @param bytes Byte array contains the data. + * @param offset Data offset. + * @param length Data length. + * @return Byte array contains the transformed data started with non-filled area with {@link #OVERHEAD} size. Review Comment: Overhead is used for two reasons 1) To avoid redundant byte array recreation on transformation . Final array must be started with -3 (TRANSFORMED) and verson. 2) To allow compressors analize compression profit (taking overhead into account). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org