-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add priority to database persistence #853
Conversation
/** | ||
* An event can be lost due to low bandwidth or disk space constraints. | ||
*/ | ||
public static final int PERSISTENCE_NORMAL = 0x01; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use a bitwise shift like in iOS?
public static final int PERSISTENCE_NORMAL = 0x01; | |
public static final int PERSISTENCE_NORMAL = 1 << 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer 0x01
. This is Java convention so we can keep hexadecimal number here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally it's more readable for me too. Admittedly it's explicitly different than how we have it in iOS but if we're following language conventions then I don't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0x01 is more readable indeed.
@@ -191,15 +208,17 @@ public boolean onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { | |||
* @param logJ The JSON string for a log. | |||
* @param targetToken target token if the log is common schema. | |||
* @param targetKey project identifier part of the target token in clear text. | |||
* @param priority priority. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's align with other parameters - first letter case and article
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Just a couple of minor things.
@@ -765,14 +768,26 @@ public void getLogsException() throws PersistenceException, JSONException { | |||
} | |||
} | |||
|
|||
@NonNull | |||
private ContentValues getContentValues(DatabasePersistence persistence, String group) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this method to the bottom or top of the file?
/** | ||
* An event can be lost due to low bandwidth or disk space constraints. | ||
*/ | ||
public static final int PERSISTENCE_NORMAL = 0x01; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer 0x01
. This is Java convention so we can keep hexadecimal number here.
|
Please have a look at our guidelines for contributions and consider the following before you submit the PR:
CHANGELOG.md
been updated?Description
Add priority field to persistence.