Skip to content
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

Revive old thrift and mark in_flume as obsoleted for Flume NG #11

Merged
merged 5 commits into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/fluent/plugin/in_flume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ class FlumeInput < Input

def initialize
require 'thrift'
$:.unshift File.join(File.dirname(__FILE__), 'thrift')
require 'flume_types'
require 'fluent/plugin/old_thrift/flume_types'
$:.unshift File.join(File.dirname(__FILE__), 'old_thrift')
require 'flume_constants'
require 'thrift_flume_event_server'

super
end

Expand All @@ -50,6 +49,7 @@ def configure(conf)

def start
log.debug "listening flume on #{@bind}:#{@port}"
log.warn "[in_flume] This plugin is obsoleted for Flume NG. You should consider to use flume-ng-fluentd-sink."

handler = FluentFlumeHandler.new
handler.tag_field = @tag_field
Expand Down
72 changes: 72 additions & 0 deletions lib/fluent/plugin/old_thrift/flume.thrift
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* Licensed to Cloudera, Inc. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Cloudera, Inc. licenses this file
* to you 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.
*/
# flume.thrift
#
# This thrift interface and service defines a network transport mechanism to move events
# from one process/machine to another. At the moment this mirrors the fields of an event
# as defined in c.c.f.core.Event.java's code .
#
# This may change more fields are likely to be added, and the actual format is subject to change.

# The server has two rpc methods
# -- append: which sends an event to the server,
# -- close: shuts down this client's connection
#
# Currently append is oneway, requiring the thrift server to do flow control.

namespace java com.cloudera.flume.handlers.thrift

typedef i64 Timestamp

enum Priority {
FATAL = 0,
ERROR = 1,
WARN = 2,
INFO = 3,
DEBUG = 4,
TRACE = 5
}

enum EventStatus {
ACK = 0,
COMMITED = 1,
ERR = 2
}

struct ThriftFlumeEvent {
1: Timestamp timestamp,
2: Priority priority,
3: binary body,
4: i64 nanos,
5: string host,
6: map<string,binary> fieldss
}

# Instead of using thrift's serialization, we just assume the contents are serialized already.
struct RawEvent {
1: binary raw
}

service ThriftFlumeEventServer {
oneway void append( 1:ThriftFlumeEvent evt ),
oneway void rawAppend( 1:RawEvent evt),
EventStatus ackedAppend( 1: ThriftFlumeEvent evt ),

void close(),
}

8 changes: 8 additions & 0 deletions lib/fluent/plugin/old_thrift/flume_constants.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions lib/fluent/plugin/old_thrift/flume_types.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

219 changes: 219 additions & 0 deletions lib/fluent/plugin/old_thrift/thrift_flume_event_server.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading