Did I find the right examples for you? yes no

All Samples(21)  |  Call(13)  |  Derive(0)  |  Import(8)

src/c/i/ciel-HEAD/src/python/ciel/runtime/fetcher.py   ciel(Download)
from ciel.runtime.pycurl_data_fetch import HttpTransferContext
from ciel.runtime.tcp_data_fetch import TcpTransferContext
from ciel.runtime.block_store import filename_for_ref, producer_filename,\
    get_own_netloc, create_datavalue_file
from ciel.runtime.producer import get_producer_for_id,\
        raise ErrorReferenceError(ref)
    if isinstance(ref, SW2_FixedReference):
        assert ref.fixed_netloc == get_own_netloc()
 
    new_client = FetchInProgress(ref, result_callback, reset_callback, 

src/c/i/ciel-HEAD/src/python/ciel/runtime/producer.py   ciel(Download)
import ciel.runtime.tcp_server
import ciel.runtime.file_watcher as fwt
from ciel.runtime.block_store import get_own_netloc, producer_filename,\
    filename_for_ref
from ciel.public.references import SWDataValue, encode_datavalue, SW2_ConcreteReference, \
    def get_stream_ref(self):
        if ciel.runtime.tcp_server.tcp_server_active():
            return SW2_SocketStreamReference(self.refid, get_own_netloc(), ciel.runtime.tcp_server.aux_listen_port)
        else:
            return SW2_StreamReference(self.refid, location_hints=[get_own_netloc()])
                return SWDataValue(self.refid, encode_datavalue(fp.read()))
        else:
            return SW2_ConcreteReference(self.refid, size_hint=self.current_size, location_hints=[get_own_netloc()])
 
    def update_chunk_size(self):

src/c/i/ciel-HEAD/src/python/ciel/runtime/pycurl_data_fetch.py   ciel(Download)
 
from ciel.runtime.pycurl_thread import pycURLContext, do_from_curl_thread
from ciel.runtime.block_store import get_fetch_urls_for_ref, create_fetch_file_for_ref, get_own_netloc
from ciel.public.references import SW2_ConcreteReference, SW2_FetchReference
import ciel.runtime.remote_stat as remote_stat
    def result(self, success):
        self.completed = True
        del active_http_transfers[self.ref.id]
        if success:
            ref = SW2_ConcreteReference(self.ref.id, self.last_progress, [get_own_netloc()])

src/c/i/ciel-HEAD/src/python/ciel/runtime/executors/__init__.py   ciel(Download)
from ciel.runtime.exceptions import BlameUserException, ReferenceUnavailableException,\
    MissingInputException, TaskFailedError
from ciel.runtime.block_store import get_own_netloc, filename_for_ref
 
from ciel.runtime.producer import make_local_output
    def get_completed_ref(self):
        completed_ref = self.output_ctx.get_completed_ref()
        if isinstance(completed_ref, SW2_ConcreteReference) and self.make_local_sweetheart:
            completed_ref = SW2_SweetheartReference.from_concrete(completed_ref, get_own_netloc())
        return completed_ref

src/c/i/ciel-HEAD/src/python/ciel/runtime/master/__init__.py   ciel(Download)
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
from __future__ import with_statement
from ciel.runtime.block_store import BlockStore, get_own_netloc
from ciel.runtime.lighttpd import LighttpdAdapter
from ciel.runtime.master.deferred_work import DeferredWorkPlugin

src/c/i/ciel-HEAD/src/python/ciel/runtime/executors/proc.py   ciel(Download)
from ciel.runtime.producer import write_fixed_ref_string, ref_from_string,\
    ref_from_safe_string
from ciel.runtime.block_store import get_own_netloc
from ciel.runtime.exceptions import BlameUserException, TaskFailedError,\
    MissingInputException, ReferenceUnavailableException
        task_private_id = ("%s:_private" % task_descriptor["task_id"])
        if is_fixed:
            task_private_ref = SW2_FixedReference(task_private_id, get_own_netloc())
            write_fixed_ref_string(pickle.dumps(task_descriptor["task_private"]), task_private_ref)
        else:
        if ctx.completed_ref is not None:
            if make_sweetheart:
                ctx.completed_ref = SW2_SweetheartReference.from_concrete(ctx.completed_ref, get_own_netloc())
            self.task_record.publish_ref(ctx.completed_ref)
        return ctx.to_safe_dict()
        else:
            if fetch.make_sweetheart:
                completed_ref = SW2_SweetheartReference.from_concrete(completed_ref, get_own_netloc())
            self.task_record.publish_ref(completed_ref)
 
        # XXX: adding this because the OngoingFetch isn't publishing the sweetheart correctly.        
        if make_sweetheart:
            self.task_record.publish_ref(SW2_SweetheartReference(ref.id, get_own_netloc()))
 
        if new_fetch.done:

src/c/i/ciel-HEAD/src/python/ciel/runtime/remote_stat.py   ciel(Download)
 
from ciel.runtime.pycurl_rpc import post_string_noreturn
from ciel.runtime.block_store import get_own_netloc
 
import simplejson
def subscribe_remote_output(refid, remote_netloc, chunk_size, subscriber):
    subscribe_remote_output_nopost(refid, subscriber)
    post_data = simplejson.dumps({"netloc": get_own_netloc(), "chunk_size": chunk_size})
    post_string_noreturn("http://%s/control/streamstat/%s/subscribe" % (remote_netloc, refid), post_data, result_callback=(lambda success, url: subscribe_result(refid, success, url)))
 
def unsubscribe_remote_output(refid):
    unsubscribe_remote_output_nopost(refid)
    netloc = get_own_netloc()
    post_data = simplejson.dumps({"netloc": netloc})
    post_string_noreturn("http://%s/control/streamstat/%s/unsubscribe" 

src/c/i/ciel-HEAD/src/python/ciel/runtime/tcp_data_fetch.py   ciel(Download)
from ciel.public.references import SW2_SocketStreamReference
from ciel.runtime.remote_stat import subscribe_remote_output_nopost, unsubscribe_remote_output_nopost
from ciel.runtime.block_store import get_own_netloc
import threading
import ciel
            subscribe_remote_output_nopost(self.ref.id, self)
            self.sock.connect((self.otherend_hostname, self.ref.socket_port))
            self.sock.sendall("%s %s %d\n" % (self.ref.id, get_own_netloc(), self.chunk_size))
            ciel.log("%s:%s connected: requesting %s (chunk size %d)" % (self.otherend_hostname, self.ref.socket_port, self.ref.id, self.chunk_size), "TCP_FETCH", logging.DEBUG)
            fp = self.sock.makefile("r", bufsize=0)