Upgrading dependency to Thrift 0.12.0
This commit is contained in:
parent
3e4590dcc0
commit
356978cb42
1302 changed files with 101701 additions and 26784 deletions
1
vendor/git.apache.org/thrift.git/contrib/fb303/cpp/FacebookBase.h
generated
vendored
1
vendor/git.apache.org/thrift.git/contrib/fb303/cpp/FacebookBase.h
generated
vendored
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "FacebookService.h"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <thrift/server/TServer.h>
|
||||
#include <thrift/concurrency/Mutex.h>
|
||||
|
||||
|
|
1
vendor/git.apache.org/thrift.git/contrib/fb303/if/fb303.thrift
generated
vendored
1
vendor/git.apache.org/thrift.git/contrib/fb303/if/fb303.thrift
generated
vendored
|
@ -24,6 +24,7 @@
|
|||
namespace java com.facebook.fb303
|
||||
namespace cpp facebook.fb303
|
||||
namespace perl Facebook.FB303
|
||||
namespace netcore Facebook.FB303.Test
|
||||
|
||||
/**
|
||||
* Common status reporting mechanism across all services
|
||||
|
|
5
vendor/git.apache.org/thrift.git/contrib/fb303/java/build.properties
generated
vendored
Normal file
5
vendor/git.apache.org/thrift.git/contrib/fb303/java/build.properties
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Maven Ant tasks Jar details
|
||||
mvn.ant.task.version=2.1.3
|
||||
mvn.repo=http://repo1.maven.org/maven2
|
||||
mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version}
|
||||
mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar
|
30
vendor/git.apache.org/thrift.git/contrib/fb303/java/build.xml
generated
vendored
30
vendor/git.apache.org/thrift.git/contrib/fb303/java/build.xml
generated
vendored
|
@ -7,9 +7,9 @@
|
|||
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
|
||||
|
@ -26,20 +26,20 @@
|
|||
<property name="interface.dir" value="${basedir}/../if"/>
|
||||
<property name="thrift.java.dir" location="${thrift.root}/lib/java"/>
|
||||
<property name="build.tools.dir" location="${thrift.java.dir}/build/tools/"/>
|
||||
<property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/>
|
||||
<property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/>
|
||||
<property file="${basedir}/build.properties"/>
|
||||
|
||||
<!-- inherit from the java build file for version and other properties -->
|
||||
<property file="${thrift.java.dir}/build.properties" />
|
||||
<property file="${thrift.java.dir}/gradle.properties" />
|
||||
|
||||
<property environment="env"/>
|
||||
|
||||
<condition property="version" value="${thrift.version}">
|
||||
<isset property="release"/>
|
||||
</condition>
|
||||
<property name="version" value="${thrift.version}-snapshot"/>
|
||||
<property name="version" value="${thrift.version}-SNAPSHOT"/>
|
||||
|
||||
<property name="fb303.final.name" value="${fb303.artifactid}-${version}"/>
|
||||
<property name="thrift.java.libthrift" value="${thrift.java.dir}/build/libthrift-${version}.jar"/>
|
||||
|
||||
<property name="src" value="${basedir}/src"/>
|
||||
<property name="gen" value="${basedir}/gen-java"/>
|
||||
|
@ -74,8 +74,12 @@
|
|||
<echo message="Building ${fb303.final.name}.jar"/>
|
||||
<javac destdir="${build.classes.dir}" debug="on">
|
||||
<classpath>
|
||||
<pathelement location="${thrift.java.libthrift}"/>
|
||||
<fileset dir="${thrift.root}/lib/java/build/lib">
|
||||
<fileset dir="${thrift.java.dir}/build/libs">
|
||||
<include name="libthrift*.jar" />
|
||||
<exclude name="libthrift*javadoc.jar" />
|
||||
<exclude name="libthrift*sources.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${thrift.java.dir}/build/deps">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</classpath>
|
||||
|
@ -120,19 +124,19 @@
|
|||
<artifact:remoteRepository id="apache" url="${apache.repo}"/>
|
||||
|
||||
<!-- Pom file information -->
|
||||
<artifact:pom id="pom"
|
||||
groupId="${thrift.groupid}"
|
||||
<artifact:pom id="pom"
|
||||
groupId="${thrift.groupid}"
|
||||
artifactId="${fb303.artifactid}"
|
||||
version="${version}"
|
||||
version="${version}"
|
||||
url="http://thrift.apache.org"
|
||||
name="Apache Thrift"
|
||||
description="Thrift is a software framework for scalable cross-language services development."
|
||||
packaging="pom"
|
||||
packaging="jar"
|
||||
>
|
||||
<remoteRepository refid="central"/>
|
||||
<remoteRepository refid="apache"/>
|
||||
<license name="The Apache Software License, Version 2.0" url="${license}"/>
|
||||
<scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
|
||||
<scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
|
||||
developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
|
||||
url="https://git-wip-us.apache.org/repos/asf?p=thrift.git"
|
||||
/>
|
||||
|
|
33
vendor/git.apache.org/thrift.git/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
generated
vendored
33
vendor/git.apache.org/thrift.git/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python
|
||||
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,7 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
from optparse import OptionParser
|
||||
|
@ -57,24 +58,20 @@ def service_ctrl(
|
|||
msg = fb_status_string(status)
|
||||
if (len(status_details)):
|
||||
msg += " - %s" % status_details
|
||||
print msg
|
||||
|
||||
if (status == fb_status.ALIVE):
|
||||
return 2
|
||||
else:
|
||||
return 3
|
||||
print(msg)
|
||||
return 2 if status == fb_status.ALIVE else 3
|
||||
except:
|
||||
print "Failed to get status"
|
||||
print("Failed to get status")
|
||||
return 3
|
||||
|
||||
# scalar commands
|
||||
if command in ["version", "alive", "name"]:
|
||||
try:
|
||||
result = fb303_wrapper(command, port, trans_factory, prot_factory)
|
||||
print result
|
||||
print(result)
|
||||
return 0
|
||||
except:
|
||||
print "failed to get ", command
|
||||
print("failed to get ", command)
|
||||
return 3
|
||||
|
||||
# counters
|
||||
|
@ -82,10 +79,10 @@ def service_ctrl(
|
|||
try:
|
||||
counters = fb303_wrapper('counters', port, trans_factory, prot_factory)
|
||||
for counter in counters:
|
||||
print "%s: %d" % (counter, counters[counter])
|
||||
print("%s: %d" % (counter.encode('utf-8'), counters[counter]))
|
||||
return 0
|
||||
except:
|
||||
print "failed to get counters"
|
||||
print("failed to get counters")
|
||||
return 3
|
||||
|
||||
# Only root should be able to run the following commands
|
||||
|
@ -96,19 +93,19 @@ def service_ctrl(
|
|||
fb303_wrapper(command, port, trans_factory, prot_factory)
|
||||
return 0
|
||||
except:
|
||||
print "failed to tell the service to ", command
|
||||
print("failed to tell the service to ", command)
|
||||
return 3
|
||||
else:
|
||||
if command in ["stop", "reload"]:
|
||||
print "root privileges are required to stop or reload the service."
|
||||
print("root privileges are required to stop or reload the service.")
|
||||
return 4
|
||||
|
||||
print "The following commands are available:"
|
||||
print("The following commands are available:")
|
||||
for command in ["counters", "name", "version", "alive", "status"]:
|
||||
print "\t%s" % command
|
||||
print "The following commands are available for users with root privileges:"
|
||||
print("\t%s" % command)
|
||||
print("The following commands are available for users with root privileges:")
|
||||
for command in ["stop", "reload"]:
|
||||
print "\t%s" % command
|
||||
print("\t%s" % command)
|
||||
|
||||
return 0
|
||||
|
||||
|
|
2
vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py
generated
vendored
2
vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py
generated
vendored
|
@ -26,7 +26,7 @@ except:
|
|||
from distutils.core import setup, Extension, Command
|
||||
|
||||
setup(name='thrift_fb303',
|
||||
version='0.10.0',
|
||||
version='1.0.0-dev',
|
||||
description='Python bindings for the Apache Thrift FB303',
|
||||
author=['Thrift Developers'],
|
||||
author_email=['dev@thrift.apache.org'],
|
||||
|
|
16
vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/pom.xml
generated
vendored
16
vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/pom.xml
generated
vendored
|
@ -7,9 +7,9 @@
|
|||
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
|
||||
|
@ -17,8 +17,8 @@
|
|||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
|||
<artifactId>thrift-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<name>thrift-maven-plugin</name>
|
||||
<version>0.10.0</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -77,6 +77,12 @@
|
|||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.10.19</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<thrift.root>${basedir}/../..</thrift.root>
|
||||
|
|
|
@ -117,7 +117,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
* @parameter default-value="${localRepository}"
|
||||
* @required
|
||||
*/
|
||||
private ArtifactRepository localRepository;
|
||||
protected ArtifactRepository localRepository;
|
||||
|
||||
/**
|
||||
* Set this to {@code false} to disable hashing of dependent jar paths.
|
||||
|
@ -129,7 +129,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
* @parameter default-value="true"
|
||||
* @required
|
||||
*/
|
||||
private boolean hashDependentPaths;
|
||||
protected boolean hashDependentPaths;
|
||||
|
||||
/**
|
||||
* @parameter
|
||||
|
@ -229,7 +229,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
checkNotNull(generator, "generator");
|
||||
final File thriftSourceRoot = getThriftSourceRoot();
|
||||
checkNotNull(thriftSourceRoot);
|
||||
checkArgument(!thriftSourceRoot.isFile(), "thriftSourceRoot is a file, not a diretory");
|
||||
checkArgument(!thriftSourceRoot.isFile(), "thriftSourceRoot is a file, not a directory");
|
||||
checkNotNull(temporaryThriftFileDirectory, "temporaryThriftFileDirectory");
|
||||
checkState(!temporaryThriftFileDirectory.isFile(), "temporaryThriftFileDirectory is a file, not a directory");
|
||||
final File outputDirectory = getOutputDirectory();
|
||||
|
@ -268,7 +268,9 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
if (temporaryThriftFileDirectory.exists()) {
|
||||
cleanDirectory(temporaryThriftFileDirectory);
|
||||
}
|
||||
|
||||
Set<File> thriftDirectories = newHashSet();
|
||||
|
||||
for (File classpathElementFile : classpathElementFiles) {
|
||||
// for some reason under IAM, we receive poms as dependent files
|
||||
// I am excluding .xml rather than including .jar as there may be other extensions in use (sar, har, zip)
|
||||
|
@ -283,18 +285,27 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
throw new IllegalArgumentException(format(
|
||||
"%s was not a readable artifact", classpathElementFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy each .thrift file found in the JAR into a temporary directory, preserving the
|
||||
* directory path it had relative to its containing JAR. Add the resulting root directory
|
||||
* (unique for each JAR processed) to the set of thrift include directories to use when
|
||||
* compiling.
|
||||
*/
|
||||
for (JarEntry jarEntry : list(classpathJar.entries())) {
|
||||
final String jarEntryName = jarEntry.getName();
|
||||
if (jarEntry.getName().endsWith(THRIFT_FILE_SUFFIX)) {
|
||||
final String truncatedJarPath = truncatePath(classpathJar.getName());
|
||||
final File thriftRootDirectory = new File(temporaryThriftFileDirectory, truncatedJarPath);
|
||||
final File uncompressedCopy =
|
||||
new File(new File(temporaryThriftFileDirectory,
|
||||
truncatePath(classpathJar.getName())), jarEntryName);
|
||||
new File(thriftRootDirectory, jarEntryName);
|
||||
uncompressedCopy.getParentFile().mkdirs();
|
||||
copyStreamToFile(new RawInputStreamFacade(classpathJar
|
||||
.getInputStream(jarEntry)), uncompressedCopy);
|
||||
thriftDirectories.add(uncompressedCopy.getParentFile());
|
||||
thriftDirectories.add(thriftRootDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (classpathElementFile.isDirectory()) {
|
||||
File[] thriftFiles = classpathElementFile.listFiles(new FilenameFilter() {
|
||||
public boolean accept(File dir, String name) {
|
||||
|
@ -307,6 +318,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ImmutableSet.copyOf(thriftDirectories);
|
||||
}
|
||||
|
||||
|
@ -319,15 +331,6 @@ abstract class AbstractThriftMojo extends AbstractMojo {
|
|||
return ImmutableSet.copyOf(thriftFilesInDirectory);
|
||||
}
|
||||
|
||||
ImmutableSet<File> findThriftFilesInDirectories(Iterable<File> directories) throws IOException {
|
||||
checkNotNull(directories);
|
||||
Set<File> thriftFiles = newHashSet();
|
||||
for (File directory : directories) {
|
||||
thriftFiles.addAll(findThriftFilesInDirectory(directory));
|
||||
}
|
||||
return ImmutableSet.copyOf(thriftFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates the path of jar files so that they are relative to the local repository.
|
||||
*
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.io.File;
|
|||
import java.util.List;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
|
||||
/**
|
||||
* @phase generate-test-sources
|
||||
|
@ -71,4 +72,22 @@ public final class ThriftTestCompileMojo extends AbstractThriftMojo {
|
|||
protected File getThriftSourceRoot() {
|
||||
return thriftTestSourceRoot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the local maven ArtifactRepository. Exposed only to allow testing outside of Maven itself.
|
||||
*
|
||||
* @param localRepository local ArtifactRepository
|
||||
*/
|
||||
public void setLocalMavenRepository(final ArtifactRepository localRepository) {
|
||||
this.localRepository = localRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the option to hash dependent JAR paths. Exposed only to allow testing outside of Maven itself.
|
||||
*
|
||||
* @param hashDependentPaths whether or not to hash paths to dependent JARs
|
||||
*/
|
||||
public void setHashDependentPaths(final boolean hashDependentPaths) {
|
||||
this.hashDependentPaths = hashDependentPaths;
|
||||
}
|
||||
}
|
||||
|
|
102
vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java
generated
vendored
Normal file
102
vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java
generated
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF 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.
|
||||
*/
|
||||
package org.apache.thrift.maven;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
|
||||
|
||||
public class TestAbstractThriftMojo {
|
||||
|
||||
private ThriftTestCompileMojo mojo;
|
||||
private File testRootDir;
|
||||
private ArtifactRepository mavenRepository;
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
|
||||
testRootDir = new File(tmpDir, "thrift-test");
|
||||
|
||||
// the truncatePath method assumes a maven repository, but it only cares about the base dir
|
||||
mavenRepository = Mockito.mock(ArtifactRepository.class);
|
||||
Mockito.when(mavenRepository.getBasedir()).thenReturn("/test/maven/repo/basedir");
|
||||
|
||||
mojo = new ThriftTestCompileMojo();
|
||||
mojo.setLocalMavenRepository(mavenRepository);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMakeThriftPathFromJars() throws Throwable {
|
||||
final File temporaryThriftFileDirectory = testRootDir;
|
||||
|
||||
// The SharedIdl.jar file contains the same idl/shared.thrift and idl/tutorial.thrift hierarchy
|
||||
// used by other tests. It's used here to represent a dependency of the project maven is building,
|
||||
// one that is contributing .thrift IDL files as well as any other artifacts.
|
||||
final Iterable<File> classpathElementFiles = Lists.newArrayList(
|
||||
new File("src/test/resources/dependency-jar-test/SharedIdl.jar")
|
||||
);
|
||||
|
||||
final Set<File> thriftDirectories = mojo.makeThriftPathFromJars(temporaryThriftFileDirectory, classpathElementFiles);
|
||||
|
||||
// The results should be a path to a directory named after the JAR itself (assuming no path hashing,
|
||||
// but see below for a separate test of that) representing the root of a hierarchy containing thrift
|
||||
// files, suitable for providing to the thrift compiler as an include directory. In this case, that
|
||||
// means it points to the directory containing the "idl" hierarchy rather than to the idl directory
|
||||
// itself.
|
||||
final Set<File> expected = Sets.newHashSet(
|
||||
new File(testRootDir, "src/test/resources/dependency-jar-test/SharedIdl.jar")
|
||||
);
|
||||
|
||||
assertEquals("makeThriftPathFromJars should return thrift IDL base path from within JAR", expected, thriftDirectories);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTruncatePath() throws Throwable {
|
||||
// JAR path is unrelated to maven repo, and should be unchanged
|
||||
assertEquals("/path/to/somejar.jar", mojo.truncatePath("/path/to/somejar.jar"));
|
||||
|
||||
// JAR path is within maven repo, and should be made relative to the repo
|
||||
assertEquals("path/to/somejar.jar", mojo.truncatePath("/test/maven/repo/basedir/path/to/somejar.jar"));
|
||||
|
||||
// JAR path contains forward slashes that should be normalized
|
||||
assertEquals("/path/to/somejar.jar", mojo.truncatePath("\\path\\to\\somejar.jar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTruncatePathWithDependentPathHashing() throws Throwable {
|
||||
mojo.setHashDependentPaths(true);
|
||||
|
||||
// hashDependentPaths set to true, the JAR path is immediately hashed (MD5) and converted to a hex string
|
||||
|
||||
assertEquals("1c85950987b23493462cf3c261d9510a", mojo.truncatePath("/path/to/somejar.jar"));
|
||||
assertEquals("39fc2b4c34cb6cb0da38bed5d8b5fc67", mojo.truncatePath("/test/maven/repo/basedir/path/to/somejar.jar"));
|
||||
assertEquals("25b6924f5b0e19486d0ff88448e999d5", mojo.truncatePath("\\path\\to\\somejar.jar"));
|
||||
}
|
||||
|
||||
}
|
4
vendor/git.apache.org/thrift.git/contrib/thrift.spec
generated
vendored
4
vendor/git.apache.org/thrift.git/contrib/thrift.spec
generated
vendored
|
@ -28,7 +28,7 @@ Name: thrift
|
|||
License: Apache License v2.0
|
||||
Group: Development
|
||||
Summary: RPC and serialization framework
|
||||
Version: 0.10.0
|
||||
Version: 0.11.0
|
||||
Release: 0
|
||||
URL: http://thrift.apache.org
|
||||
Packager: Thrift Developers <dev@thrift.apache.org>
|
||||
|
@ -234,5 +234,5 @@ umask 007
|
|||
/sbin/ldconfig > /dev/null 2>&1
|
||||
|
||||
%changelog
|
||||
* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
|
||||
* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
|
||||
- Thrift 0.9.0 release.
|
||||
|
|
2
vendor/git.apache.org/thrift.git/contrib/zeromq/TZmqServer.cpp
generated
vendored
2
vendor/git.apache.org/thrift.git/contrib/zeromq/TZmqServer.cpp
generated
vendored
|
@ -21,7 +21,7 @@
|
|||
#include <thrift/transport/TBufferTransports.h>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
using boost::shared_ptr;
|
||||
using apache::thrift::stdcxx::shared_ptr;
|
||||
using apache::thrift::transport::TMemoryBuffer;
|
||||
using apache::thrift::protocol::TProtocol;
|
||||
|
||||
|
|
4
vendor/git.apache.org/thrift.git/contrib/zeromq/TZmqServer.h
generated
vendored
4
vendor/git.apache.org/thrift.git/contrib/zeromq/TZmqServer.h
generated
vendored
|
@ -28,7 +28,7 @@ namespace apache { namespace thrift { namespace server {
|
|||
class TZmqServer : public TServer {
|
||||
public:
|
||||
TZmqServer(
|
||||
boost::shared_ptr<TProcessor> processor,
|
||||
apache::thrift::stdcxx::shared_ptr<TProcessor> processor,
|
||||
zmq::context_t& ctx, const std::string& endpoint, int type)
|
||||
: TServer(processor)
|
||||
, processor_(processor)
|
||||
|
@ -56,7 +56,7 @@ class TZmqServer : public TServer {
|
|||
}
|
||||
|
||||
private:
|
||||
boost::shared_ptr<TProcessor> processor_;
|
||||
apache::thrift::stdcxx::shared_ptr<TProcessor> processor_;
|
||||
int zmq_type_;
|
||||
zmq::socket_t sock_;
|
||||
};
|
||||
|
|
4
vendor/git.apache.org/thrift.git/contrib/zeromq/csharp/ThriftZMQ.csproj
generated
vendored
4
vendor/git.apache.org/thrift.git/contrib/zeromq/csharp/ThriftZMQ.csproj
generated
vendored
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>0.10.0</ProductVersion>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>0.10.0.%2a</ApplicationVersion>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
|
|
4
vendor/git.apache.org/thrift.git/contrib/zeromq/test-client.cpp
generated
vendored
4
vendor/git.apache.org/thrift.git/contrib/zeromq/test-client.cpp
generated
vendored
|
@ -6,7 +6,7 @@
|
|||
#include "TZmqClient.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
using apache::thrift::stdcxx::shared_ptr;
|
||||
using apache::thrift::transport::TZmqClient;
|
||||
using apache::thrift::protocol::TBinaryProtocol;
|
||||
|
||||
|
@ -17,7 +17,7 @@ int main(int argc, char** argv) {
|
|||
if (argc > 1) {
|
||||
incr = atoi(argv[1]);
|
||||
if (incr) {
|
||||
socktype = ZMQ_DOWNSTREAM;
|
||||
socktype = ZMQ_PUSH;
|
||||
endpoint = "tcp://127.0.0.1:9091";
|
||||
}
|
||||
}
|
||||
|
|
4
vendor/git.apache.org/thrift.git/contrib/zeromq/test-client.py
generated
vendored
4
vendor/git.apache.org/thrift.git/contrib/zeromq/test-client.py
generated
vendored
|
@ -15,7 +15,7 @@ def main(args):
|
|||
if len(args) > 1:
|
||||
incr = int(args[1])
|
||||
if incr:
|
||||
socktype = zmq.DOWNSTREAM
|
||||
socktype = zmq.PUSH
|
||||
endpoint = "tcp://127.0.0.1:9091"
|
||||
|
||||
ctx = zmq.Context()
|
||||
|
@ -29,7 +29,7 @@ def main(args):
|
|||
time.sleep(0.05)
|
||||
else:
|
||||
value = client.get()
|
||||
print value
|
||||
print(value)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
2
vendor/git.apache.org/thrift.git/contrib/zeromq/test-receiver.cpp
generated
vendored
2
vendor/git.apache.org/thrift.git/contrib/zeromq/test-receiver.cpp
generated
vendored
|
@ -2,7 +2,7 @@
|
|||
#include "TZmqServer.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
using apache::thrift::stdcxx::shared_ptr;
|
||||
using apache::thrift::TProcessor;
|
||||
using apache::thrift::server::TZmqServer;
|
||||
using apache::thrift::server::TZmqMultiServer;
|
||||
|
|
2
vendor/git.apache.org/thrift.git/contrib/zeromq/test-sender.cpp
generated
vendored
2
vendor/git.apache.org/thrift.git/contrib/zeromq/test-sender.cpp
generated
vendored
|
@ -6,7 +6,7 @@
|
|||
#include "TZmqClient.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
using apache::thrift::stdcxx::shared_ptr;
|
||||
using apache::thrift::transport::TZmqClient;
|
||||
using apache::thrift::protocol::TBinaryProtocol;
|
||||
|
||||
|
|
4
vendor/git.apache.org/thrift.git/contrib/zeromq/test-server.cpp
generated
vendored
4
vendor/git.apache.org/thrift.git/contrib/zeromq/test-server.cpp
generated
vendored
|
@ -2,7 +2,7 @@
|
|||
#include "TZmqServer.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
using apache::thrift::stdcxx::shared_ptr;
|
||||
using apache::thrift::TProcessor;
|
||||
using apache::thrift::server::TZmqServer;
|
||||
using apache::thrift::server::TZmqMultiServer;
|
||||
|
@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
zmq::context_t ctx(1);
|
||||
TZmqServer reqrep_server(processor, ctx, "tcp://0.0.0.0:9090", ZMQ_REP);
|
||||
TZmqServer oneway_server(processor, ctx, "tcp://0.0.0.0:9091", ZMQ_UPSTREAM);
|
||||
TZmqServer oneway_server(processor, ctx, "tcp://0.0.0.0:9091", ZMQ_PULL);
|
||||
TZmqMultiServer multiserver;
|
||||
multiserver.servers().push_back(&reqrep_server);
|
||||
multiserver.servers().push_back(&oneway_server);
|
||||
|
|
2
vendor/git.apache.org/thrift.git/contrib/zeromq/test-server.py
generated
vendored
2
vendor/git.apache.org/thrift.git/contrib/zeromq/test-server.py
generated
vendored
|
@ -22,7 +22,7 @@ def main():
|
|||
|
||||
ctx = zmq.Context()
|
||||
reqrep_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9090", zmq.REP)
|
||||
oneway_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9091", zmq.UPSTREAM)
|
||||
oneway_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9091", zmq.PULL)
|
||||
multiserver = TZmqServer.TZmqMultiServer()
|
||||
multiserver.servers.append(reqrep_server)
|
||||
multiserver.servers.append(oneway_server)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue