
com.stratio.deep.cassandra.functions.CellList2TupleFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deep-cassandra Show documentation
Show all versions of deep-cassandra Show documentation
Project containing the actual implementation of the RDD integrating Apache Spark and Apache Cassandra
/*
* Copyright 2014, Stratio.
*
* Licensed 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 com.stratio.deep.cassandra.functions;
import com.stratio.deep.commons.entity.Cells;
import com.stratio.deep.commons.functions.AbstractSerializableFunction;
import scala.Tuple2;
/**
* Function that converts a Cells element to tuple of two Cells.
* The first Cells element contains the list of Cell elements that represent the key (partition + cluster key).
* The second Cells element contains all the other columns.
*/
public class CellList2TupleFunction extends AbstractSerializableFunction> {
private static final long serialVersionUID = -8057223762615779372L;
/**
* {@inheritDoc}
*/
@Override
public Tuple2 apply(Cells cells) {
Cells keys = cells.getIndexCells();
Cells values = cells.getValueCells();
return new Tuple2<>(keys, values);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy