Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is meant as a template for writing a DP (DistributedLog Proposal). To create a DP choose DP-Template on creating a page and modify with your content and replace the heading with the next DP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state[One of  "Under Discussion", "Accepted", "Rejected"]

Discussion thread:  [link]

JIRA:  [link]

Released: <DL version>

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Describe the problems you are trying to solve.

Public Interfaces

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.

A public interface is any change to the following:

  • Data format, Metadata format

  • The wire protocol and api behavior

  • Any class in the public packages

  • Monitoring

  • Command line tools and arguments

  • Anything else that will likely break existing users in some way when they upgrade

Proposed Changes

Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users? 
  • If we are changing behavior how will we phase out the older behavior? 
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Test Plan

Describe in few sentences how the DP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?

Rejected Alternatives

Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyDL-72

Released: 0.4.0

Motivation

Finalize the stream operation primitives in distributedlog.

Public Interfaces

All supported stream primitives are listed as below.

PrimitiveStatusJiraNotes
#openLogDone Open a distributedlog stream
#deleteLogDone Delete a distributedlog stream
#getLogsDone List all the log streams under a given namespace
#markEndOfStreamDone Seal a log stream
#truncateDone Truncate a log stream
#getLogStatus
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyDL-73
 Get the status/attributes of a log stream
#renameLog
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyDL-74
 Rename a distributedlog stream
#listLogs
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyDL-75
 List all the log streams under a given path
#symlink
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyDL-76
 Create a symlink stream for a log stream
#fork
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyDL-77
 Fork a log stream

 

Proposed Changes

GetLogStatus

Proposed API:

Future<LogStatus> getLogStatus(String streamName);

Proposed Changes:
Code Block
Struct LogStatus {
	required long creation_time;
	required long modification_time;
	required int ensemble_size;
	required int write_quorum_size;
	required int ack_quorum_size;
	optional String symlinkLog;
	optional Map<byte[], byte[]> attributes;
}

 

The LogStatus is serialized and stored under the root znode of the log stream.

Rename

Proposed API:

Future<LogStatus> renameLog(String oldStreamName, String newStreamName);

Proposed Changes:

It will be a zookeeper transaction to copy all the znodes to the new location.

List

Proposed API:

Future<List<LogStatus>> listLogs(String logPath);

Proposed Changes:

It will get all the children under a given path and retrieve the `LogStatus` for each child stream.

Proposed API:

Future<Void> symlink(String realLogPath, String symlinkLogPath);

Proposed Changes:

It will create a log stream with LogStatus (symlink = 'real log path').

Fork

Proposed API: (Added to AsyncLogWriter)

Future<AsyncLogWriter> fork(String newLogStreamName);

 

Code Block
AsyncLogWriter writer = ...;
AsyncLogWriter forkedWriter = FutureUtils.result(writer.fork('newStream'));
 

 

Proposed Changes:

At the forking time, the writer will do following:

  • Create a new log stream 'newStream'. The new log stream will copy the list of log segments, whose log segments will be symlinked to the original log segments.
  • Once the metadata is ready, the current writer will close the current in progress log segment.
  • All the writes happened after 'fork' will go to a new log segment.

Compatibility, Deprecation, and Migration Plan

 

N/A - Doesn't change existing primitives

Test Plan

N/A

Rejected Alternatives

N/AIf there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.