-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3863 Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
- Loading branch information
Showing
22 changed files
with
1,127 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
janusgraph-cql/src/main/java/org/janusgraph/diskstorage/cql/CQLKeyColValGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2023 JanusGraph Authors | ||
// | ||
// 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 org.janusgraph.diskstorage.cql; | ||
|
||
import com.datastax.oss.driver.api.core.cql.Row; | ||
import io.vavr.Tuple4; | ||
import org.janusgraph.diskstorage.EntryMetaData; | ||
import org.janusgraph.diskstorage.StaticBuffer; | ||
import org.janusgraph.diskstorage.util.StaticArrayEntry; | ||
|
||
//TODO: remove it | ||
public class CQLKeyColValGetter implements StaticArrayEntry.GetKeyColVal<Tuple4<StaticBuffer, StaticBuffer, StaticBuffer, Row>, StaticBuffer> { | ||
|
||
private final EntryMetaData[] schema; | ||
|
||
CQLKeyColValGetter(final EntryMetaData[] schema) { | ||
this.schema = schema; | ||
} | ||
|
||
@Override | ||
public StaticBuffer getKey(Tuple4<StaticBuffer, StaticBuffer, StaticBuffer, Row> tuple) { | ||
return tuple._1; | ||
} | ||
|
||
@Override | ||
public StaticBuffer getColumn(final Tuple4<StaticBuffer, StaticBuffer, StaticBuffer, Row> tuple) { | ||
return tuple._2; | ||
} | ||
|
||
@Override | ||
public StaticBuffer getValue(final Tuple4<StaticBuffer, StaticBuffer, StaticBuffer, Row> tuple) { | ||
return tuple._3; | ||
} | ||
|
||
@Override | ||
public EntryMetaData[] getMetaSchema(final Tuple4<StaticBuffer, StaticBuffer, StaticBuffer, Row> tuple) { | ||
return this.schema; | ||
} | ||
|
||
@Override | ||
public Object getMetaData(final Tuple4<StaticBuffer, StaticBuffer, StaticBuffer, Row> tuple, final EntryMetaData metaData) { | ||
switch (metaData) { | ||
case TIMESTAMP: | ||
return tuple._4.getLong(CQLKeyColumnValueStore.WRITETIME_COLUMN_NAME); | ||
case TTL: | ||
return tuple._4.getInt(CQLKeyColumnValueStore.TTL_COLUMN_NAME); | ||
default: | ||
throw new UnsupportedOperationException("Unsupported meta data: " + metaData); | ||
} | ||
} | ||
} |
Oops, something went wrong.