-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #456 moved notification deletion to end of transaction
- Loading branch information
1 parent
6b9f630
commit cc257fb
Showing
16 changed files
with
357 additions
and
160 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
47 changes: 47 additions & 0 deletions
47
modules/core/src/main/java/io/fluo/core/impl/Notification.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,47 @@ | ||
/* | ||
* Copyright 2014 Fluo authors (see 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 io.fluo.core.impl; | ||
|
||
import io.fluo.accumulo.util.ColumnConstants; | ||
import io.fluo.api.data.Bytes; | ||
import io.fluo.api.data.Column; | ||
import io.fluo.api.data.RowColumn; | ||
import io.fluo.core.util.ColumnUtil; | ||
import io.fluo.core.util.Flutation; | ||
import org.apache.accumulo.core.security.ColumnVisibility; | ||
|
||
public class Notification extends RowColumn { | ||
private long timestamp; | ||
|
||
public Notification(Bytes row, Column col, long ts) { | ||
super(row, col); | ||
this.timestamp = ts; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public Flutation newDelete(Environment env) { | ||
return newDelete(env, getTimestamp()); | ||
} | ||
|
||
public Flutation newDelete(Environment env, long ts) { | ||
Flutation m = new Flutation(env, getRow()); | ||
ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(getColumn()); | ||
m.putDelete(ColumnConstants.NOTIFY_CF.toArray(), ColumnUtil.concatCFCQ(getColumn()), cv, ts); | ||
return m; | ||
} | ||
} |
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
Oops, something went wrong.