Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add HostWeightInfo fields/struct.

  • Loading branch information...
commit a309191b4fc0d24a311fd84f2107bbbac2dbcac0 1 parent 463f74c
Stu Hood stuhood authored
2  README.rdoc
View
@@ -49,7 +49,7 @@ To execute the tests:
2. Pull in test server dependencies (once, or whenever you want to change the Gizzard version):
- cd test/test_server ; sbt clean-lib update
+ cd test/test_server ; sbt clean clean-lib update
3. Run rake (the default target is the test suite: all files ending in '_spec' in the test directory):
22 lib/gizzard/thrift.rb
View
@@ -78,6 +78,22 @@ def to_unix
end
end
+ HostWeightInfo = T.make_struct(:HostWeightInfo,
+ T::Field.new(:hostname, T::STRING, 1),
+ T::Field.new(:weight_write, T::DOUBLE, 2),
+ T::Field.new(:weight_read, T::DOUBLE, 3)
+ )
+
+ class HostWeightInfo
+ def inspect
+ "HostWeight(#{hostname} read=#{weight_read} write=#{weight_write})"
+ end
+
+ def to_unix
+ [hostname, weight_read, weight_write].join("\t")
+ end
+ end
+
Forwarding = T.make_struct(:Forwarding,
T::Field.new(:table_id, T::I32, 1),
T::Field.new(:base_id, T::I64, 2),
@@ -98,7 +114,8 @@ def inspect
T::Field.new(:shards, list(struct(ShardInfo)), 1),
T::Field.new(:links, list(struct(LinkInfo)), 2),
T::Field.new(:forwardings, list(struct(Forwarding)), 3),
- T::Field.new(:table_id, T::I32, 4)
+ T::Field.new(:table_id, T::I32, 4),
+ T::Field.new(:host_weights, list(struct(HostWeightInfo)), 5)
)
@@ -230,6 +247,9 @@ class Manager < GizzmoService
thrift_method :shards_for_hostname, list(struct(ShardInfo)), field(:hostname, string, 1), :throws => exception(GizzardException)
thrift_method :get_busy_shards, list(struct(ShardInfo)), :throws => exception(GizzardException)
+ thrift_method :set_host_weight, void, field(:host_weight, struct(HostWeightInfo), 1), :throws => exception(GizzardException)
+ thrift_method :list_host_weights, list(struct(HostWeightInfo)), :throws => exception(GizzardException)
+
thrift_method :list_upward_links, list(struct(LinkInfo)), field(:id, struct(ShardId), 1), :throws => exception(GizzardException)
thrift_method :list_downward_links, list(struct(LinkInfo)), field(:id, struct(ShardId), 1), :throws => exception(GizzardException)
thrift_method :get_forwarding, struct(Forwarding), field(:table_id, i32, 1), field(:base_id, i64, 2), :throws => exception(GizzardException)
2  test/test_server/project/build/Project.scala
View
@@ -7,7 +7,7 @@ class GizzmoServerProject(info: ProjectInfo) extends StandardProject(info) {
override def filterScalaJars = false
val scalaTools = "org.scala-lang" % "scala-compiler" % "2.7.7"
- val gizzard = "com.twitter" % "gizzard" % "3.0.10"
+ val gizzard = "com.twitter" % "gizzard" % "3.0.16-SNAPSHOT-stuhood"
val querulous = "com.twitter" % "querulous" % "2.6.5"
val specs = "org.scala-tools.testing" % "specs" % "1.6.2.1" % "test"
Please sign in to comment.
Something went wrong with that request. Please try again.